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 / 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"
# 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
@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)
doskey /macrofile=%userprofile%\doskeys.txt
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'>";
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);
@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"
@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 / webrequestproxy.cs
Created January 4, 2012 02:58
Set WebRequest.Proxy to Null
private WebResponse BuildAndGetResponse()
{
string url = BuildUrl();
WebRequest request = null;
WebResponse response = null;
request = WebRequest.Create(url);
request.Proxy = null; // muy importanté
response = request.GetResponse();
return response;
window.q = [];
window.$ = function(f){
q.push(f);
};
//... jQuery now loaded. run all jQuery "ready" functions queued up
$.each(window.q,function(key,val){
$(val);
});