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
formats = { | |
"fe-common/core" = { | |
own_msg = "{ownmsgnick $2 {ownnick $[-10]0}}$1"; | |
own_msg_channel = "{ownmsgnick $3 {ownnick $[-10]0}{msgchannel $1}}$2"; | |
pubmsg_me = "{pubmsgmenick $2 {menick $[-10]0}}$1"; | |
pubmsg_me_channel = "{pubmsgmenick $3 {menick $[-10]0}{msgchannel $1}}$2"; | |
pubmsg_hilight = "{pubmsghinick $0 $3 $[-10]1}$2"; | |
pubmsg_hilight_channel = "{pubmsghinick $0 $4 $[-10]1{msgchannel $2}}$3"; | |
pubmsg = "{pubmsgnick $2 {pubnick $[-10]0}}$1"; | |
pubmsg_channel = "{pubmsgnick $3 {pubnick $[-10]0}{msgchannel $1}}$2"; |
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
// All elements which match this will be syntax highlighted. | |
var selector = 'code'; | |
var keywords = ('var function if else for while break switch case do new ' | |
+'continue delete return this true false throw catch typeof').split(' '); | |
// Syntax definition | |
// The key becomes the class name of the <span> | |
// around the matched block of code. | |
var syntax = { |
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
/*jslint white: true, onevar: true, undef: true, nomen: true, eqeqeq: true, | |
plusplus: true, bitwise: true, regexp: true, immed: true, maxlen: 78, | |
indent: 2 */ | |
// Does short term (100ms) in-memory caching and combines concurrent requests | |
// to the same resource into a single callback group. | |
var Safe = module.exports = function Safe(fn, expires) { | |
// return fn; | |
var cache = {}, | |
queues = {}; |
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
map.path('/domain', function () { | |
this.get(); // match 'GET /domain' | |
this.root; // match 'GET /domain/' | |
this.get('/info'); // match 'GET /domain/info' | |
this.path('/users', function () { | |
this.post(); // match 'POST /domain/users' | |
this.get(); // match 'GET /domain/users' | |
}); | |
}) |
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
vows.describe('format.js library').addVows({ | |
"toNumber(42)": { | |
"on an instance of Number": { | |
topic: new Number( 42 ), | |
"can format strict number":function( n ){ | |
assert.equal( true, n instanceof Number ); | |
}}, | |
"on a number literal": { | |
topic: 42, | |
"can format loose number":function( n ){ |
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
vows.describe('format.js library').addVows({ | |
"Number formatting": { | |
// run this once, and execute the following tests when it completes | |
topic: 42, | |
"is the number":function(n){ | |
assert.equal(n,42); | |
} | |
} | |
}); |
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
properties: { | |
title: { | |
type: 'string', | |
conditional: { | |
optional: { | |
value: true, | |
when: function () { // The 'optional' attribute only takes effect if this function returns true | |
return !this.published; // So the title is only optional if the article hasn't been published. | |
} |
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
input ! click { | |
delay: 1ms; | |
} | |
! fadeOut { | |
time: 100ms; | |
} | |
input#search ! tokenize { | |
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
// | |
// Recursively traverse a hierarchy, returning | |
// a list of all relevant .js files. | |
// | |
function paths(dir) { | |
var paths = []; | |
try { fs.statSync(dir) } | |
catch (e) { return [] } |
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 src="less.js"></script> | |
<link rel="less" href="main.less" type="text/css"> |