Skip to content

Instantly share code, notes, and snippets.

View tdegrunt's full-sized avatar

Tom de Grunt tdegrunt

View GitHub Profile
@tdegrunt
tdegrunt / batman.simple.rest.coffee
Created February 18, 2012 10:40
batman.js SimpleRestStorage
applyExtra = (Batman) ->
# TODO: What's this?
Batman.mixin Batman.Encoders,
railsDate:
encode: (value) -> value
decode: (value) ->
a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value)
if a
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6]))
else
@tdegrunt
tdegrunt / gist:1883433
Created February 22, 2012 08:30
testling dependencies
substack : testling-server $ npm ls
[email protected] /home/substack/projects/testling-server
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
@tdegrunt
tdegrunt / gist:1923565
Created February 27, 2012 12:59 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@tdegrunt
tdegrunt / Tomorrow.xml
Created March 6, 2012 21:00
Tomorrow Theme (Webstorm)
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Tomorrow" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="CARET_ROW_COLOR" value="efefef" />
<option name="LINE_NUMBERS_COLOR" value="666969" />
<option name="SELECTION_BACKGROUND" value="d6d6d6" />
</colors>
@tdegrunt
tdegrunt / remove_old_linux_kernels.sh
Created May 5, 2012 14:06
Remove old linux kernels
sudo apt-get -y purge $(dpkg --get-selections | awk '((/^linux-/) && (/[0-9]\./) && (!/'"`uname -r | sed "s/-generic//g"`"'/)) {print $1}')
@tdegrunt
tdegrunt / start.sh
Created July 4, 2012 09:20
3G Rate limiting
sudo ipfw add pipe 1 in
sudo ipfw add pipe 2 out
sudo ipfw pipe 1 config bw 780Kbit/s delay 100ms plr 0.1
sudo ipfw pipe 2 config bw 330Kbit/s delay 100ms plr 0.1
@tdegrunt
tdegrunt / start.sh
Created July 4, 2012 09:23
Edge Rate limiting
sudo ipfw add pipe 1 in
sudo ipfw add pipe 2 out
sudo ipfw pipe 1 config bw 240Kbit/s delay 400ms plr 0.1
sudo ipfw pipe 2 config bw 200Kbit/s delay 440ms plr 0.1
@tdegrunt
tdegrunt / Gemfile
Created April 5, 2013 15:18 — forked from gorenje/Gemfile
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "quantal64_vb428"
config.vm.customize ["modifyvm", :id, "--memory", 512]
config.ssh.forward_agent = true
config.vm.provision :chef_solo do |chef|