Skip to content

Instantly share code, notes, and snippets.

View gcman105's full-sized avatar

Gary Cheeseman gcman105

View GitHub Profile
@gcman105
gcman105 / gitignore-all-but-org.md
Last active August 29, 2015 14:08
.gitignore to ignore almost everything apart from `.org` files.

I have set up the gitignore to ignore almost everything apart from .org files.

.gitignore file

*
!.gitattributes
!.gitignore
!README.md
!.gitkeep
@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 &
@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)
; =>
@jaberg
jaberg / ipython-virtualenv.py
Created November 1, 2012 15:49 — forked from bsweger/ipython-virtualenv.py
(Linux) make iPython virtual env aware
#------------------------------------------------------------------------------
# Make things VirtualEnv aware (Linux version).
# More info: http://www.swegler.com/becky/blog/2011/08/28/python-django-mysql-on-windows-7-part-3-ipython-virtual-environments/
# add this to the end of ipython_config
# (or course, for virtualenvs created via --no-site-packages, it would
# be much easier just to install iPython)
#
# Also consider sourcing this file from ipython_config with execfile().
#
#------------------------------------------------------------------------------