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 CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :login, :null => false # optional, you can use email instead, or both | |
t.string :email, :null => false # optional, you can use login instead, or both | |
t.string :crypted_password, :null => false # optional, see below | |
t.string :password_salt, :null => false # optional, but highly recommended | |
t.string :persistence_token, :null => false # required | |
t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params | |
t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8"> | |
<title>test.rb</title> | |
<link rel="stylesheet" href="http://github.com/jashkenas/docco/raw/0.3.0/resources/docco.css"> | |
</head> | |
<body> | |
<div id='container'> | |
<div id="background"></div> |
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
# get rid of these parens? | |
define('List'). | |
oid('_id'). | |
string('title'). | |
string('description') |
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
// define all common settings here | |
exports.common = { | |
storage: { | |
host: 'localhost', | |
database: 'server_dev', | |
user: 'qirogami_user', | |
password: 'password' | |
} | |
}; |
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
assert.throws( | |
function() { | |
throw new Error("Wrong value"); | |
}, | |
Error | |
); |
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
assert = require('assert') | |
class MyError | |
constructor: (@message, @name='bar') -> #nop | |
try | |
throw new Error('baz') | |
throw new MyError('foo') | |
catch err | |
console.log err.message |
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 async = require('async'); | |
var assert = require('assert'); | |
engines = ['one', 'two', 'three']; | |
async.filter(engines, function(item, callBack){ | |
callBack(item != 'two'); | |
}, function(results){ | |
assert.deepEqual(results, ['one', 'three']); |
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
# using named functions | |
doSomething = (done) -> | |
mainWindow.menu "File", onFile | |
onFile = (er, file) -> | |
return cb(er) if er | |
file.openMenu onMenu | |
onMenu = (er, menu) -> | |
return er if er |
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
head.ready -> | |
# create 10,000 messages | |
s = '' | |
messages = [] | |
for i in [0...10000] | |
messages.push from: 'me', text: "blah blah" | |
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
### index.lua | |
return require("./lib/luv") | |
### lib/luv.lua | |
local luv = {} | |
_G.task = function(name, description, ...) | |
end | |
return luv |
OlderNewer