This file contains 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 sys = require ('sys'); | |
module.exports = function(app) { | |
function NotFound(msg) { | |
this.name = 'NotFound'; | |
Error.call(this, msg); | |
Error.captureStackTrace(this, arguments.callee); | |
} |
This file contains 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(){ | |
$.getJSON('http://search.twitter.com/search.json?callback=?&q=oivoodoo&rpp=5', function(data){ | |
var html = ""; | |
for(var i = 0; i < data.results.length; i++) { | |
var tweet = data.results[i]; | |
html += "<div class='tweet'><a href='http://twitter.com/oivoodoo/'>@oivoodoo</a>:<span>" + tweet.text + '</span></div>'; | |
} | |
$('#twitter').html(html); | |
}); | |
This file contains 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 Account < ActiveRecord::Base | |
has_many :memberships, :class_name => 'AccountAdministrator' | |
has_many :administrators, :through => :memberships | |
end | |
class Administrator < ActiveRecord::Base | |
has_many :memberships, :class_name => 'AccountAdministrator' | |
has_many :accounts, :through => :memberships | |
accepts_nested_attributes_for :memberships |
This file contains 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
{ | |
"name": "chrome-games", | |
"description": "Small webserver for storing games settings", | |
"version": "0.0.1", | |
"author": "Alexander Korsak<alex.korsak@gmail.com>", | |
"contributors": [ | |
{ "name": "Alexander Korsak", "email": "alex.korsak@gmail.com" } | |
], | |
"dependencies": { | |
"express": ">= 2.0.0", |
This file contains 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
sys = require('sys') | |
express = require('express') | |
jade = require('jade') | |
connect = require('connect') | |
stylus = require('stylus') | |
RedisStore = require('connect-redis')(connect) | |
app = express.createServer( | |
connect.cookieParser() | |
connect.static(__dirname + '/public'), |
This file contains 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(global) { | |
global.DateTime = DateTime = {}; | |
DateTime.instance = (function() { | |
return { | |
getTime: function(date, offset, format) { | |
var date = new Date(date.getTime() + offset * 1000); | |
return date.getUTCHours() + ":" + date.getUTCMinutes(); | |
} | |
}; | |
})(); |
This file contains 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
/* | |
* Wrapper for html5 local storage | |
*/ | |
var Storage = function() {}; | |
Storage.define = function(table) { | |
window.localStorage[table] = window.localStorage[table] || "[]"; | |
return new Table(table); | |
}; |
This file contains 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
inherit = (function() { | |
var F = function() {}; | |
return function(C, P) { | |
F.prototype = P.prototype; | |
C.prototype = new F(); | |
C.uber = P.prototype; | |
C.prototype.constructor = C; | |
}; | |
})(); |
This file contains 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() { | |
var BaseController = function(link) { | |
var context = this; | |
this.link = link; | |
this.syncLink = link + "/sync"; | |
$(window).bind('online', function() { | |
context.sync(); | |
}); | |
}; |
This file contains 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 'net/https' | |
require 'open-uri' | |
url = URI.parse(YOUR_SERVER_URL) | |
http_session = Net::HTTP.new(uri.host, uri.port) | |
http_session.use_ssl = true if uri.port == 443 | |
http_session.start { |http| | |
} |
OlderNewer