Skip to content

Instantly share code, notes, and snippets.

View jmwhittaker's full-sized avatar

James Whittaker jmwhittaker

View GitHub Profile
#!/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
#
// We all know how to use mixins, right?
@mixin kung {
background: green;
color: yellow;
}
@mixin foo {
background: orange;
color: red;
@jmwhittaker
jmwhittaker / app.js
Created November 26, 2012 12:47
Something every Angular.js app should have
//mimic if statement for angular
//Schema: if(expression, 'foo', 'bar')
$scope['if'] = function(condition, a, b) {
return condition ? a : b;
};
//mimic switch case for angular
//Schema: switch(colorid, [[1,'red'], [2,'green'], [3, 'blue']], 'black')
$scope['switch'] = function (expression, cases, thedefault) {
for(var i = 0; i < cases.length; i++) {
@jmwhittaker
jmwhittaker / Globalgram_Arduino_Code.ino
Created August 25, 2012 15:09 — forked from andrewhaskin/Globalgram_Arduino_Code.ino
Arduino Code for a Rotary Switch and a Button used for Globalgram
// RotarySwitch.pde -- test out a rotary switch (not a rotary encoder)
// Tod E. Kurt, http://todbot.com/blog/
////4-position rotary switch
const int firstRotaryPin = 3;
const int lastRotaryPin = 7;
int button = 9; ////button input
int input1 = LOW;
@jmwhittaker
jmwhittaker / crunchy_pubsub.js
Created May 9, 2012 17:28 — forked from plukevdh/crunchy_pubsub.js
Faux pubsub. Could also use jQuery event binding if you rather.
crunch.pubsub = _.extend({}, Backbone.Events);
// Hide backbone implementation by aliasing
crunch.pubsub.publish = crunch.pubsub.trigger;
crunch.pubsub.subscribe = crunch.pubsub.bind;
crunch.pubsub.unsubscribe = crunch.pubsub.unbind;

A pure CSS bendy shadow:

I suspect that some trig calculations could make this very general.

bendy_shadow