Skip to content

Instantly share code, notes, and snippets.

View moredip's full-sized avatar

Pete Hodgson moredip

View GitHub Profile
/**
* Code Syntax Highlighter for Objective-C.
* Version 0.0.2
* Copyright (C) 2006 Shin, YoungJin.
* http://www.jiniya.net/lecture/techbox/test.html
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
@moredip
moredip / run-command-on-git-revisions
Created May 8, 2011 06:58
A quieter version of Gary Bernhardt's script, with timestamps
#!/bin/bash
#
# This script runs a given command over a range of Git revisions. Note that it
# will check past revisions out! Exercise caution if there are important
# untracked files in your working tree.
#
# This came from Gary Bernhardt's dotfiles:
# https://github.com/garybernhardt/dotfiles
#
# Example usage:
function createDuck( name ){
var duck = {
fullName: function(){ name + " duck"; }
};
return duck;
};
@moredip
moredip / registerCustomer.coffee
Created April 9, 2012 16:35
Alternative functional approach to dealing with the async pyramid. This is a response to http://wekeroad.com/2012/04/05/cleaning-up-deep-callback-nesting-with-nodes-eventemitter/
validate = (customer, next)->
console.log 'validating...'
#VALIDATE HERE
next()
insert = (customer, next)->
console.log 'inserting...'
# insert into DB (asynchronously of course), and then call...
next()
@moredip
moredip / gist:3080744
Created July 10, 2012 03:16
Simple Privacy Policy
We don't have access to and will not store, or use any of your information or data or stuff for any reason.
@moredip
moredip / build.rb
Created August 19, 2012 17:06
A very hacky build script using Guard
require 'fileutils'
def run_guard
Signal.trap("HUP") { exit }
require 'guard'
Guard.setup
Guard::Dsl.evaluate_guardfile(:guardfile => 'Guardfile')
Guard.start
end
@moredip
moredip / test.json
Created November 28, 2012 22:49
A small sample JSON file
{
"test":"json"
}
+ (void)prepRoutes{
[self handlePostTo:@"/record" with:^{
return [[LPRecordRoute new] autorelease];
}];
[self handlePostTo:@"/play" with:^{
return [[LPAsyncPlaybackRoute new] autorelease];
}];
@moredip
moredip / gist:7557707
Last active December 28, 2015 20:29
exporting a bunch of public keys
for i in pete rosalie jack charlton pam coleman badri sophie elise jess; do gpg --armor --export $i > $i.signed.gpg; done
@moredip
moredip / env.rb
Created April 3, 2014 23:32
How to point capybara to custom phantom or chromedriver executable
if RUBY_PLATFORM =~ /darwin/
require 'selenium/webdriver'
Selenium::WebDriver::PhantomJS.path = File.expand_path( "../../../tools/phantomjs-osx", __FILE__ )
Selenium::WebDriver::Chrome::Service.executable_path = File.expand_path( "../../../tools/chromedriver-osx", __FILE__ )
end