Skip to content

Instantly share code, notes, and snippets.

View cfurrow's full-sized avatar
🐢
Can you fix my bugs faster than I can write them? I doubt it.

Carl Furrow cfurrow

🐢
Can you fix my bugs faster than I can write them? I doubt it.
View GitHub Profile
@cfurrow
cfurrow / star.less
Created September 21, 2011 15:14
LESS CSS is cool
// rating-stars mixin
.stars(@stars:0){
@height:19px;
display:inline-block; // make sure it's some type of block element
height:@height;
width:110px;
background-image:url(../images/star-ratings-small.png);
background-position: 0px @stars*-@height;
background-repeat: no-repeat;
}
@cfurrow
cfurrow / .bash_profile
Created March 24, 2011 20:43
Git alias to remove deleted files (seems to detect renamed files as well after they're added to the index)
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
var source = " <p>If you'd like to filter by your custom-defined ids, select them below.</p>";
source += " <ul class='clusters'>";
source += " {{#clusters}}";
source += " <li class='cluster' data-ids='{{ids}}'>";
source += " {{name}}";
source += " </li>";
source += " {{/clusters}}";
source += " </ul>";
var template = Handlebars.compile(source);
var data = {
"properties":[
{name:"Some property", address: "Some address", forsale: "yes"},
{name:"Some other property", address: "Some other address", forsale: "no"},
]
};
var source = "<ul class='properties'>";
source += "{{#properties}}";
source += " <li class='property'>";
doskey /macrofile=%userprofile%\doskeys.txt
@project_directory = "org/carlfurrow/unhuman"
@project_jar = @project_directory.gsub(/\//,".") + ".jar"
desc "Build the app, output a jar, then run"
task :default, [:env] do |t, arg|
Rake::Task[:compile].execute
# copy the manifest file
sh "cp src/#{@project_directory}/Manifest.txt bin/"
Rake::Task[:jar].execute
Rake::Task[:run].execute(arg)
# local/app.rb
module Nesta
class App
helpers do
def gist(gn,filename=nil)
if(!filename.nil?)
filename = "?file=#{filename}"
end
"<script type='text/javascript' src='https://gist.github.com/#{gn}.js#{filename}'></script>"
end
@cfurrow
cfurrow / config.ru
Created November 24, 2010 14:40
config.yml
# If in production, (i.e. on Dreamhost) set the GEM_PATH to my local
# home directory, and not use the Dreamhost server's GEM_PATH
if( ENV['RACK_ENV'] == 'production' )
ENV['GEM_PATH'] = "/home/cfurrow/.gems"
Gem.clear_paths
end
require "rack"
require "rubygems"
require "sinatra"
require "./app"
# ... snipped
Nesta::Plugins.load_local_plugins #=> Should load gist_helper.rb, below
module Nesta
class App < Sinatra::Base
register Sinatra::Cache
set :root, File.dirname(__FILE__)
set :cache_enabled, Config.cache
$ git clone git://github.com/gma/nesta.git