Category: Programming

  • Using GitHub with SSH Keys

    Generate SSH Key on your system$ ssh-keygen -t ed25519 -C “” View you new SSH Key$ ~/.ssh/ Open github, go to setting, SSH and GPG Keys, click add a new key,page contents of into box.

  • My notes on how to use git

    1) create a local git repo $ git init 1.5) Save username and password for github $ git config credential.helper store $ git push Username: <type your username> Password: <type your password> 2) Add all the files in the currect folder $ git add * 3) Commit the files/changes $ git commit -m “first…

  • PHP Script to return random D&D Monster name

    I wanted to have a quick an easy way to get a random name, from say a list of D&D monsters. But I wanted the script to be accessible from anywhere on the network. So I wrote this simple PHP script and put it on a web server.

  • Installing Visual Studio Code on RHEL

    RHEL, Fedora, and CentOS based distributions We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository: sudo rpm –import sudo sh -c ‘echo -e “[code]\nname=Visual Studio Code\nbaseurl=\nenabled=1\ngpgcheck=1\ngpgkey=” > /etc/yum.repos.d/vscode.repo’ Then update the package cache and install the package using dnf (Fedora 22 and…

  • Tail -f for windows

    Use the powershell command get-content -wait

  • Getting Started with CocoaPods

    Installation make sure the ruby system is up to date $ sudo gem update –system install cocoapods $ sudo gem install cocoapods If you get an error message about fuzzy_match, try this command instead, $ sudo gem install -n /usr/local/bin cocoapods setup the pods $ pod setup To Test / use cocoa pods Create a…

  • Connecting a second ViewContoller to another Swift file

    Make sure the swift file looks like the default ViewContoller.swift file i.e. import UIKit, inherits from UIViewController, have at least the viewDidLoad function Click on the yellow dot that represents the view controller in the story board Select the identify inspector page In the Class drop down at the top, you should be able to…

  • Detecting iPad or iPhone in swift

    To detect if the user is using an iPad or iPhone or something else in Swift do something like this: switch UIDevice.current.userInterfaceIdiom { case .phone: deviceLavel.text = “iPhone” case .pad: deviceLavel.text = “iPad” case .unspecified: deviceLavel.text = “unspecified” case .tv: deviceLavel.text = “tv” case .carPlay: deviceLavel.text = “carPlay” }

  • How to record an App Preview

    1. Connect your iPhone or iPad to you Mac 2. Open Quick Time Player 3. From the File menu, Choose new Movie recording 4. Fromt the drop down next to the record button choose you iphone/ipad for video and microphone 5. Click record 6. Do steps 7. Click Stop 8. File | Save 9. Add…

  • Using a bigger Range of colours from code in Unity

      Create a new C# script in your project called CSSColors.cs and then copy and paste the code below into it. You should then be able to use the colour names specified anywhere in your project. public class CSSColors { // NOTE: The follwing color names come from the CSS3 specification, // Section 4.3 Extended…