Skip to content

Instantly share code, notes, and snippets.

View gcman105's full-sized avatar

Gary Cheeseman gcman105

View GitHub Profile
@michaeldwan
michaeldwan / heroku_deploy.rake
Created July 4, 2010 02:08
Simple Rake task for customizing deployment to Heroku
# List of environments and their heroku git remotes
ENVIRONMENTS = {
:staging => 'myapp-staging',
:production => 'myapp-production'
}
namespace :deploy do
ENVIRONMENTS.keys.each do |env|
desc "Deploy to #{env}"
task env do
@jashkenas
jashkenas / 1-adjacency.js
Created December 10, 2010 22:18
Snippet from Zepto.js, translated to CoffeeScript.
var adjacencyOperators = {
append: 'beforeEnd',
prepend: 'afterBegin',
before: 'beforeBegin',
after: 'afterEnd'
};
for (key in adjacencyOperators)
$.fn[key] = (function(operator) {
return function(html){
@unamashana
unamashana / js2cs.rb
Created July 6, 2011 05:15
Converting a Javascript Project to CoffeeScript
#SRC_BASE_DIR = "public/javascripts/backbone"
#DEST_BASE_DIR = "app/coffeescripts/backbone"
SRC_BASE_DIR = "spec/javascripts"
DEST_BASE_DIR = "spec/coffeescripts"
JS2COFFEE = "~/node_modules/js2coffee/bin/js2coffee"
dirs = []
files = []
Dir.glob("#{SRC_BASE_DIR}/**/*.js").each do |file|
@AnsonT
AnsonT / gist:1115264
Created July 30, 2011 06:32
CoffeeScript debugging with node-inspector
node-inspector &
coffee --nodejs --debug app.coffee &
google-chrome http://127.0.0.1:8080/debug?port=5858 &
google-chrome http://127.0.0.1:3000 &
@andyfowler
andyfowler / .vimrc
Created September 5, 2011 18:08
Swap iTerm2 cursors in vim insert mode when using tmux
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
@timgremore
timgremore / index.html.haml
Created January 3, 2012 21:13
Ember.js, document collection and polling...written in CoffeeScript
- title "#{@game.name}"
%h1= yield(:title)
#documents
= form_tag(assessment_game_documents_path(@game)) do
%ul
%script{ type: "text/x-handlebars" }
{{#collection Game.DocumentsCollectionView contentBinding="Game.documentsController"}}
%li {{content.name}}
{{/collection}}
@garth
garth / Jakefile.js
Created January 16, 2012 18:37 — forked from wagenet/Assetfile.rb
Precompile .handlebars templates with Jake (nodejs)
var fs = require('fs')
var vm = require('vm')
var handlebarsjs = fs.readFileSync('path/to/handlebars.js', 'utf8')
var emberjs = fs.readFileSync('path/to/ember.js', 'utf8')
var templatesDir = 'path/to/template/dir'
desc('Compile all .handlebars templates')
task({ 'handlebars': [] }, function () {
process.stdout.write('Compiling .handlebars templates')
@jeanphix
jeanphix / server.coffee
Created March 20, 2012 17:02
brunch github OAuth2
sysPath = require 'path'
express = require 'express'
oauth = require 'oauth'
_appSecret = "myawesomesecret"
_githubUrl = "https://github.com/login"
_githubKey = "xxxxxxxxxxxxxx"
_githubSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
_githubCallBack = "http://my.app/signin/callback"
@danivovich
danivovich / factory_girl_step_helpers.rb
Created March 22, 2012 01:39
Factory Girl steps for Turnip
module FactoryGirlStepHelpers
def convert_human_hash_to_attribute_hash(human_hash, associations = [])
HumanHashToAttributeHash.new(human_hash, associations).attributes
end
class HumanHashToAttributeHash
attr_reader :associations
def initialize(human_hash, associations)
@human_hash = human_hash
@ChasManRors
ChasManRors / gist:2920837
Created June 12, 2012 23:43
Yasnippet issue Debugger entered when emacs.d/init.el executes (yas/global-mode 1)
(emacs-version nil)
; =>
;"GNU Emacs 24.0.97.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
; of 2012-05-16 on bob.porkrind.org"
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
; =>
; ("~/.emacs.d/plugins/yasnippet" "~/.emacs.d/rc-site-lisp" "/Users/cmmagid/.emacs.d/el-get/package/elpa/idle-highlight-mode-1.1.2" "/Users/cmmagid/.emacs.d/el-get/package/elpa/rainbow-mode-0.2" "/Users/cmmagid/.emacs.d/el-get/package/elpa/ruby-electric-1.1" "/Users/cmmagid/.emacs.d/el-get/package/elpa/save-visited-files-1.2" "/Users/cmmagid/.emacs.d/el-get/package/elpa/wrap-region-0.6.0" "/Users/cmmagid/.emacs.d/el-get/yasnippet" "/Users/cmmagid/.emacs.d/el-get/yaml-mode" "/Users/cmmagid/.emacs.d/el-get/vline" "/Users/cmmagid/.emacs.d/el-get/tree-mode" "/Users/cmmagid/.emacs.d/el-get/rinari/util/jump/" ...)
(require 'yasnippet)
; =>