Skip to content

Instantly share code, notes, and snippets.

View levicole's full-sized avatar

Levi Cole levicole

  • Kolide
  • Nashville, TN
View GitHub Profile
@levicole
levicole / org.nginx.plist
Created July 19, 2012 19:34
nginx launch agent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.nginx</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
class TestCase
class AssertionFailed < RuntimeError; end
def assert(exp, message='Expected assertion to pass')
unless exp
raise AssertionFailed.new(message)
else
puts 'it passed'
end
end
function parse_git_deleted {
[[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-"
}
function parse_git_added {
[[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+'
}
function parse_git_modified {
[[ $(git status 2> /dev/null | grep modified:) != "" ]] && echo "*"
}
function parse_git_dirty {
@levicole
levicole / remarkable.yml
Created January 16, 2012 19:13
Remarkable locale file for rspec 1 compatibility
en:
remarkable:
active_record:
describe:
each: "%{key} is %{value}"
prepend: "when "
connector: " and "
expectations:
allow_nil: "%{subject_name} to %{not}allow nil values for %{attribute}"
allow_blank: "%{subject_name} to %{not}allow blank values for %{attribute}"
@levicole
levicole / gist:1443537
Created December 7, 2011 16:46
my vim snippets
Turn symbols into strings
s/:\(\w\{1,\}\)/"\1"/g
function parse_git_deleted {
[[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-"
}
function parse_git_added {
[[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+'
}
function parse_git_modified {
[[ $(git status 2> /dev/null | grep modified:) != "" ]] && echo "*"
}
function parse_git_dirty {
$ ->
$canvas = ($ '#glcanvas')[0]
gl = $canvas.getContext('experimental-webgl')
gl.clearColor(0.0, 0.0, 0.5, 1.0)
gl.clear(gl.COLOR_BUFFER_BIT)
fshader = gl.createShader(gl.FRAGMENT_SHADER)
gl.shaderSource(fshader, 'void main(void) {gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);}')
gl.compileShader(fshader)
if (!gl.getShaderParameter(vshader, gl.COMPILE_STATUS))
unless $rails_rake_task
require 'ruby-debug'
Debugger.settings[:autoeval] = true
Debugger.settings[:autolist] = 1
Debugger.settings[:reload_source_on_change] = true
Debugger.start_remote
end
require 'rubygems'
require 'bundler'
Bundler.require
require './app'
require 'sass/plugin/rack'
root = ::File.dirname(__FILE__)
song{
tempo 120
instrument bass{
type square
punch 0.441
sustain 0.067
decay 0.197
freq 0.499
}
instrument lead {