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 forms = require('cruciform').forms; | |
var BlogAuthorForm = forms.form({ | |
'email':forms.EmailField({required:false}), | |
'type':forms.ChoiceField({ | |
'choices':{ | |
0:'Email Account', | |
1:'Reddit Account', | |
2:'Gmail Account' | |
}, |
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'); | |
// | |
// Here's how prototypical inheritance works. | |
// | |
var Klass = function(val) { | |
this.value = val; | |
}; |
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
Javascript.forEach('Pythonista') | |
================================ | |
An outline. | |
----------- | |
01. Intro | |
- Who this is for | |
- What this is | |
- Terms |
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
// QuerySet inherits from EventEmitter, | |
// so the result of this method can be used like so: | |
// var result = qs.filter({'something__something':'something_else'}); | |
// result.on('data', function(result) { console.log(result); }); | |
// or: | |
// qs.filter({'something__something':'something_else'})(function(err, results) { | |
// !err && console.log(results); | |
// }); |
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
// call this when we're done. | |
var done = function(err, result) { | |
console.log(result); | |
}; | |
var EXPENSIVE_OPERATION_ON = function(data, callback) { | |
callback(/*error, data, etc*/); | |
}; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
ul { float:left; margin-right:20px; } | |
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); } | |
ul { width:512px; overflow:hidden; border-radius:6px; } |
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
### Symphony 2.0.x ### | |
Options +FollowSymlinks -Indexes | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteBase / | |
### DO NOT APPLY RULES WHEN REQUESTING "favicon.ico" | |
RewriteCond %{REQUEST_FILENAME} favicon.ico [NC] |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div id="something"> | |
<p class="hi">hi</p> | |
<p>there</p> |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
div { background:white; margin:0; padding:0; font-family:sans-serif; } | |
#beta { z-index:0; height:40px; background:#CCC; } | |
.target { -webkit-transition:top 0.4s ease; position:relative; z-index:1; top:-56px; height:200px; } | |
#close { display:none; } |
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 objectYouWantToBeCallable = { | |
'hi':3, | |
'there':4 | |
}; | |
var makeCallable = function(obj, onCall) { | |
// these make the proxy act *exactly* like the base obj | |
var baseHandler = { | |
set:function(rcvr, name, val) { return (obj[name] = val); }, | |
get:function(rcvr, name) { return obj[name]; } |