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 obj = { | |
name: 'Good McGoodson', | |
last_menstrual_period: 41 | |
}; | |
validate(obj, [ "name.length between 1 and 100", "lmp between 0 and 40"]]); // returns ["lmp must be between 0 and 40"] |
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
// \n at the end! | |
console.log(require('crypto').createHash('sha1').update('blob 14\0Hello, World!\n').digest('hex')); | |
$> 8ab686eafeb1f44702738c8b0f24f2567c36da6d |
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
$> db.tiles.find({}).sort({ 'voteCount': 1, 'hash': 1}).skip(1000).limit(10).explain() | |
{ | |
"queryPlanner" : { | |
"plannerVersion" : 1, | |
"namespace" : "heroku_app35335042.tiles", | |
"indexFilterSet" : false, | |
"parsedQuery" : { | |
"$and" : [ ] | |
}, | |
"winningPlan" : { |
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
body { | |
font-family: "Helvetica", "sans-serif"; | |
width: 400px; | |
float: left; | |
} | |
#banner { | |
background: #f7b; | |
color: #fff; | |
padding: 1px; |
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 express = require('express'), | |
app = express(); | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
}); | |
/** | |
*/ | |
app.get('/', function (req, res) { |
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
// Paste this in the address bar and then use zoom in/out to navigate easier | |
// you may need to type in "javascript:" in the address bar manually | |
javascript:$('#comic').css('overflow', '');$('#topContainer, #bottom, .comicNav, #comic > img:first-child').hide() | |
// firefox does not allow you to do this from the address bar. For that, open the Scratchpad (Shift + F4) and execute: | |
$('#comic').css('overflow', '');$('#topContainer, #bottom, .comicNav, #comic > img:first-child').hide() |
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
1.9.3-p0 :002 > Crimson::Parser.parse('nil') | |
Exception: Parse error: Expected one of -, 0, nil at line 1, column 4 (byte 4) after . | |
from /Users/jnh/Dev/Toys/CrimsonScript/lib/crimson/parser.rb:12:in `parse' | |
from (irb):2 | |
from /Users/jnh/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>' | |
1.9.3-p0 :003 > Crimson::Parser.parse('0') | |
Exception: Parse error: Expected one of -, 0, nil at line 1, column 2 (byte 2) after . | |
from /Users/jnh/Dev/Toys/CrimsonScript/lib/crimson/parser.rb:12:in `parse' | |
from (irb):3 | |
from /Users/jnh/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>' |
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
execve("/usr/local/bin/node", ["node", "test.js"], [/* 38 vars */]) = 0 | |
brk(0) = 0x2b7a000 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fce53525000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY) = 3 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=124100, ...}) = 0 | |
mmap(NULL, 124100, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fce53506000 | |
close(3) = 0 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<sop id="DLM3931700" irdnumbering="no" raised.by="Government" sop.no="265" stage="published" xml:lang="en-NZ" year="2011" year.imprint="2011"><date>Thursday, 4 August 2011</date><billref>Aquaculture Legislation Amendment Bill (No 3)</billref><body id="DLM3931701"><heading>Proposed amendments</heading><motion>Hon Phil Heatley, in Committee, to move the following amendments:</motion><sop.amend id="DLM3931702"><clause.ref>Clause 13: new section 25A</clause.ref><sop.para><text><emphasis style="italic">Subsections (9) and (10)</emphasis>: to omit these subsections (lines 19 to 28 on page 21) and substitute the following subsections:</text><instrument.amend close.quote="no" open.quote="yes" quote="1"><subprov quote="1" skeleton="no"><label auto.number="no" denominator="yes" quote="1">9</label><para><text>The chief executive must decline the application, if the applicant does not lodge—</text><label-para quote="1" skeleton="no"><label auto.number="no" denominator="yes" quote="1 |
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 index = 0, | |
words = ['badger', 'badger', 'badger', 'badger', 'badger', 'mushroom'] | |
$.extend({ | |
badger: function() { | |
return words[index++ % words.length]; | |
} | |
}); | |
}(jQuery)); |
NewerOlder