Skip to content

Instantly share code, notes, and snippets.

View rchatham's full-sized avatar
👨‍💻
code code code...

Reid Chatham rchatham

👨‍💻
code code code...
View GitHub Profile
class ApiKey {
// id will be {prefix}.{hash_of_api_key}
private String id;
private String name;
private Set<String> scopes;
@JsonProperty("prefix")

#Setting up Docker Machine on Raspberry PI

  1. SSH into the pi and install docker with curl -sSL https://get.docker.com | sh (If we let Machine try to install the Docker daemon it will fail.)
  2. Change the OS's ID so Docker Machine won't throw errors. sudo nano /etc/os-release and change the line that says ID=raspbian to ID=debian
  3. From a new terminal window run docker-machine create --driver generic --generic-ip-address YOUR-PIS-IP --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pi --engine-storage-driver overlay2 MACHINE-NAME
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 18, 2024 13:59
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@iraycd
iraycd / horrible-storyboard.md
Created June 10, 2015 14:20
Bad Experiences with Storyboard.

Interestingly Apple doesn't even use Storyboards in their recently open-sourced ResearchKit as [Peter Steinberger has noticed][1] (under the subheading "Interface Builder").

As expected, Apple keeps improving Storyboards and Xcode. Some of the points that applied to iOS 7 and below don't apply to iOS 8 anymore (and are now marked as such). So while Storyboards inherently still have flaws, I revise my advice from don't use to selectively use where it makes sense.

Even now that iOS 7 is out, I would advise against to use caution when deciding whether to use Storyboards. Here are my reasons:

  • Storyboards fail at runtime, not at compile time: You have a typo in a segue name or connected it wrong in your storyboard? It will blow up at runtime. You use a custom UIViewController subclass that doesn't exist anymore in your storyboard? It will blow up at runtime. If you do such things in code, you will catch them early on, during compile time. Update: My new tool **[StoryboardLin
@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@adrianorsouza
adrianorsouza / sublime-command-line.md
Last active September 26, 2023 16:26
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing