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
khug:appjstest kieran$ npm install appjs | |
npm http GET https://registry.npmjs.org/appjs | |
npm http 304 https://registry.npmjs.org/appjs | |
npm http GET https://registry.npmjs.org/mime/1.2.5 | |
npm http GET https://registry.npmjs.org/tar | |
npm http GET https://registry.npmjs.org/request | |
npm http 304 https://registry.npmjs.org/mime/1.2.5 | |
npm http 304 https://registry.npmjs.org/tar | |
npm http 304 https://registry.npmjs.org/request | |
npm http GET https://registry.npmjs.org/inherits |
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 Router = require('barista').Router // <-- require the router | |
, http = require('http') | |
, util = require('util') | |
var router = new Router // <-- create the router | |
// define some routes | |
router.get('/').to('app.index') | |
router.resource('products') |
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 Router = require('barista').Router // <-- require the router | |
, http = require('http') | |
, util = require('util') | |
var router = new Router // <-- create the router | |
// define some routes | |
router.get('/').to('app.index') | |
router.resource('products') |
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 a = Array(Math.floor(Math.random()*11)) | |
function randArray(){ | |
for (var i = 0; i < 10; i++) { | |
a[i] = Math.floor(Math.random()*11) | |
} | |
return a | |
} | |
for (var i = 0; i < 100000; i++) { |
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
%script{:type=>'text/javascript', :src=>'http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js'} |
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
$("#element").droppable({ | |
tolerance: 'pointer', | |
activeClass: 'ui-state-active', | |
hoverClass: 'ui-state-hover', | |
drop: function(evt, ui) { | |
console.log('dropped',evt,ui) | |
} | |
}); | |
$('.ui-droppable').live('dropover dropout',function(evt,ui){ |
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 util = require('util'); | |
var somevar = "lexical scope is fun" | |
try{ | |
util.puts(somevar) // lexical scope works | |
throw new Error(somevar) | |
}catch(e){ | |
util.puts('exception caught:' + e.message) | |
} |
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 salt = 'a bunch on meaningless stuff unique to your app...9278uiydfis87f9sd8f8sdf' | |
function saltify(password){ | |
return sha1(password+salt) | |
} | |
function addUser(userParams){ | |
userParams.password = saltify(userParams.password) | |
// save user in the datastore | |
} |
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
source :rubygems | |
# Dependencies are generated using a strict version, | |
# Don't forget to edit the dependency versions when upgrading. | |
merb_gems_version = "1.1.3" | |
merb_related_gems = "~> 1.1.0" | |
dm_gems_version = "~> 1.0" | |
# If you did disable json for Merb, comment out this line. |
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 fresh/router.js | |
var Router = function () { | |
this.routes = []; | |
// .... | |
var Route = function(){ | |
var name = "myRoute"; | |
} | |
Route.prototype.toString = function() { |