Skip to content

Instantly share code, notes, and snippets.

View jmwhittaker's full-sized avatar

James Whittaker jmwhittaker

View GitHub Profile
@staltz
staltz / introrx.md
Last active May 30, 2024 18:43
The introduction to Reactive Programming you've been missing
@tvwerkhoven
tvwerkhoven / rsync_backup.sh
Last active July 5, 2023 05:30 — forked from necolas/rsync_backup
Improved script: - Check if run as root - Clarify rsync(1) flags - Add --inplace for performance, extra preservation flags - Check bless(8) target before setting Improved exclusion file: - Included files listed by Carbon Copy Cloner
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#
@corkupine
corkupine / userdatacaching.coffee
Created August 24, 2012 22:04
Fixed caching UserDataService
mod = angular.module('myApp.services', ['ngResource']);
mod.factory('UserData', ($resource,$location) ->
return $resource('http://' + $location.host() + '/Services/userinfo')
)
.factory('UserDataStore', ($resource, $location, UserData, $q, $rootScope) ->
GetUserDataFromXhr = () ->
deferred = $q.defer()
UserData.get((userdata) ->
deferred.resolve userdata.userInfo
@blackfalcon
blackfalcon / 1_example_mixin.scss
Created May 18, 2012 05:32
That BOOM moment where we discovered the real power of @extend
// We all know how to use mixins, right?
@mixin kung {
background: green;
color: yellow;
}
@mixin foo {
background: orange;
color: red;
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@digerata
digerata / RoundedRectLabel.h
Created July 30, 2010 16:12
Create a UILabel with a rounded rect background like in the iPhone Mail app. (Much faster than using UILabel.layer.cornerRadius)
//
// RoundedRectLabel.h
//
#import <UIKit/UIKit.h>
@interface CountLabel : UILabel {
NSInteger cornerRadius;
UIColor *rectColor;
}