This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doskey /macrofile=%userprofile%\doskeys.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |