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
describe("tablesort", function() { | |
var table = "<table class='tablesorter' id='sorted'><thead><th>Foo</th><th>Blah</th></thead><tbody>" + | |
"<tr><td>3</td><td>2</td></tr>" + | |
"<tr><td>100</td><td>5</td></tr>" + | |
"<tr><td>1</td><td>5</td></tr>" + | |
"</tbody></table>"; | |
it( "creates a tablesorter and sorts properly", function() { | |
$("#harness").html(table); | |
$('#sorted').tablesorter(); | |
// Should have the order we put it in. |
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
# Filters added to this controller apply to all controllers in the application. | |
# Likewise, all the methods added will be available for all controllers. | |
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
# See ActionController::RequestForgeryProtection for details | |
# Uncomment the :secret if you're not using the cookie session store | |
protect_from_forgery # :secret => 'c2e35e370a3af3722c0a1c4df84c4855' | |
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
node> | |
http:909 | |
parser.finish(); | |
^ | |
TypeError: Cannot call method 'finish' of undefined | |
at Client.onend (http:909:12) | |
at IOWatcher.callback (net:493:28) | |
at node.js:221:9 |
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
Chris-Dawsons-MacBook-Pro:node-lib xrdawson$ node foo.js | |
http:909 | |
parser.finish(); | |
^ | |
TypeError: Cannot call method 'finish' of undefined | |
at Client.onend (http:909:12) | |
at IOWatcher.callback (net:493:28) | |
at node.js:221:9 |
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
So, if I have this code: | |
function doSomething() { | |
var a = 1; | |
client.addListener( 'response', handleResponse ); | |
} | |
function handleResponse(data) { | |
// this should crash, right? | |
sys.puts( "Total: " + a ); |
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
// So, if I have this code: | |
function doSomething() { | |
var a = 1; | |
client.addListener( 'response', handleResponse ); | |
} | |
function handleResponse(data) { | |
// this should crash, right? | |
sys.puts( "Total: " + a ); |
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
Blah-MacBook-Pro:eco blah$ gem install json | |
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and | |
/usr/bin aren't both writable. | |
WARNING: You don't have /Users/blah/.gem/ruby/1.8/bin in your PATH, | |
gem executables will not run. | |
Building native extensions. This could take a while... | |
Successfully installed json-1.4.3 | |
1 gem installed | |
Installing ri documentation for json-1.4.3... | |
Installing RDoc documentation for json-1.4.3... |
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
# user.rb | |
class User | |
include DataMapper::Resource | |
# has_and_belongs_to_many :groups | |
has n, :groups, :through => Resource | |
has n, :links | |
property :id, Serial |
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
Chris-Dawsons-MacBook-Pro:node xrdawson$ ./connect | |
module:238 | |
throw new Error("Cannot find module '" + request + "'"); | |
^ | |
Error: Cannot find module 'multipart' | |
at loadModule (module:238:15) | |
at require (module:364:12) | |
at Object.<anonymous> (/Users/xrdawson/xxx/filemgr/node/uploads.js:1:79) |
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.paths.unshift("./lib"); | |
var Connect = require('connect'); | |
var sys = require('sys'); | |
var MemoryStore = require('connect/middleware/session/memory'); | |
function handleLogin( json, req, res, next ) { | |
sys.puts( "In handle login" ); | |
req.sessionStore.regenerate(req, function(err){ | |
req.session.profile = json.profile; | |
req.session.username = json.profile.displayName; |
OlderNewer