Skip to content

Instantly share code, notes, and snippets.

View chrissloey's full-sized avatar

Chris Sloey chrissloey

View GitHub Profile
@chrissloey
chrissloey / bookmarklet.js
Created July 31, 2015 10:08
Bookmarklet to go from GitHub page to project
javascript:window.location = "https://github.com/" + window.location.host.split('.')[0] + window.location.pathname
@chrissloey
chrissloey / related_posts.rb
Last active August 29, 2015 14:17
Jekyll Related Blog Posts
@chrissloey
chrissloey / d
Created February 27, 2015 20:06
Docker helper function
# Acts like `docker`
# No arguments: `docker status`
# Ensures docker env is setup
# Starts docker-machine if necessary
d() {
if [ -z "$DOCKER_HOST" ];
then $(docker-machine env)
fi
if [[ $# > 0 ]]; then
@chrissloey
chrissloey / NSUserDefaultsExtension.swift
Last active August 29, 2015 14:16
NSUserDefaults extension to synchronize values set within a block
//
// NSUserDefaultsExtension.swift
//
// Created by Chris Sloey on 24/02/2015.
// Copyright (c) 2015 Add Jam. All rights reserved.
//
import Foundation
extension NSUserDefaults {
@chrissloey
chrissloey / RealmExtension.md
Last active January 11, 2019 17:46
Extensions to Realm

Extensions to make Realm even simpler.

Transactions

RLMRealm.transaction { realm in
  let person = Person()
  person.name = "Banana King"
  person.age = 24
}

Keybase proof

I hereby claim:

  • I am chrissloey on github.
  • I am chriss (https://keybase.io/chriss) on keybase.
  • I have a public key whose fingerprint is 7D2A 90BC 3280 C08A 31AB 6C2E 4E77 2230 B726 CF69

To claim this, I am signing this object: