Skip to content

Instantly share code, notes, and snippets.

andyferra / github.css
Created Apr 30, 2012
Github Markdown CSS - for Markdown Editor Preview
View github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
andyferra / qr-code-bookmarklet.js
Created Nov 5, 2010
Just a little bookmarklet that will open a new window with a QR code for the current page's URL
View qr-code-bookmarklet.js
javascript:(function(){ '' + document.location.href,'qrcodepopup','width=700,height=700') })();
andyferra / js_reek.rb
Created Mar 3, 2011
Helps you identify unused functions in your javascript.
View js_reek.rb
js_files = Dir['*.js', 'lib/*.js', 'messages/*.js']
defined_functions = {|file|
[ file, /function ([_a-z0-9]+)/i ).flatten.uniq ]
}.reject {|file_name, functions| functions.empty? }
called_functions = {|file| {|file_name, functions| functions } do |function| /(?<!function )#{function}/
View spiffy_data.js
var $$ = function(param) {
var node = $(param)[0];
var id = $.data(node);
$.cache[id] = $.cache[id] || {};
$.cache[id].node = node;
return $.cache[id];
// Now, instead of doing $("#foo").data("foo") and ("#foo").data("foo", "bar"),
// you can do $$("#foo").foo and $$("#foo").foo = bar.
View email-tag-requirements.txt
- invitor
- (custom) url
- tribe
- user
- (custom) memberships_url
andyferra / vividchalkish.itermcolors
Created Jul 6, 2012
Colors for iTerm that are pretty close to vividchalk.vim
View vividchalkish.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Blue Component</key>
<key>Green Component</key>
andyferra / production.rb
Created Jun 16, 2009
Consolidate pre-deployment tasks before shipping to Heroku
View production.rb
# Supresses automatic updates of SASS so as not to offend your Heroku slug
Sass::Plugin.options[:never_update] = true
andyferra / chosen_helper.rb
Created May 8, 2012
Chosen Select Capybara Helper
View chosen_helper.rb
def chooze_from original_field_selector, *selected_values
original_field = find original_field_selector
original_field_id = original_field[:id]
container_selector = "##{ original_field_id }_chzn"
container = find container_selector
if container[:class].include? 'chzn-container-multi'
activator = find "#{ container_selector } .chzn-choices"
andyferra / gist:1217638
Created Sep 14, 2011
find and replace text in a directory
View gist:1217638
grep -rl test_database_client . | xargs gsed -i 's/test_database_client/test_db/g'
View config
Host *
ForwardAgent yes
Compression yes
ControlMaster auto
IdentitiesOnly yes
ForwardAgent no
Host *