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
require 'rubygems' | |
require 'sinatra' | |
require 'open-uri' | |
get "/highFive.jsonp" do | |
content_type :jsonp | |
open("http://www.itpcakemix.com/project/HI5SON!!").read | |
end | |
get "/" do |
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 date = new Date(data.rows[i].doc.created_at); | |
date.setHours(date.getHours()+4); |
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
<html> | |
<head> | |
<title></title> | |
<script src="http://code.jquery.com/jquery-1.4.2.min.js" ></script> | |
<script> | |
$(window).load(function() | |
{ | |
$.ajax({ | |
url: "http://www.itpcakemix.com/project/HI5SON!!", | |
dataType: 'jsonp', |
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
require 'oauth2' | |
get '/' do | |
require_user | |
erb :index | |
end | |
get '/oauth' do | |
session[:access_token] = github_client.token(params[:code]) | |
redirect '/' |
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
class Github | |
include HTTParty | |
base_uri 'https://api.github.com' | |
end | |
Github.post("/user/repos", :query => { | |
:access_token => @token | |
}, | |
:body => { | |
:name => name, |
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
# create the gem | |
bundle gem crazygem | |
# move into folder | |
cd crazygem | |
# now develop the gem | |
# to use gem from disk in a project, do this in Gemfile | |
gem 'crazygem', :path => '/Users/rune/Projects/gems/crazygem' |
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
PImage img; | |
int pixelSize = 5; | |
void setup() | |
{ | |
noStroke(); | |
img = loadImage("subway.jpg"); | |
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
# In your datamapper class you can define caching per environment | |
class Post | |
include DataMapper::Resource | |
enable_caching :production | |
property :id, Serial | |
property :title, String | |
property :body, Text | |
property :created_at, DateTime | |
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
function test(anotherfunction) | |
{ | |
anotherfunction(); | |
} | |
test(function() { | |
console.log("This is called in the test function"); | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Untitled Document</title> | |
<link href="statusBoard.css" rel="stylesheet" type="text/css" /> | |
<script type="text/x-jquery-tmpl" id="testBuildTemplate"> | |
<tr><td data-bind="id: statusClass"></td><td data-bind="text: name"></td></tr> | |
</script> |