Skip to content

Instantly share code, notes, and snippets.

View cloudhead's full-sized avatar
🌴
On vacation

Alexis Sellier cloudhead

🌴
On vacation
View GitHub Profile
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";
// 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 = {
/*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 = {};
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'
});
})
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 ){
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);
}
}
});
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.
}
input ! click {
delay: 1ms;
}
! fadeOut {
time: 100ms;
}
input#search ! tokenize {
//
// Recursively traverse a hierarchy, returning
// a list of all relevant .js files.
//
function paths(dir) {
var paths = [];
try { fs.statSync(dir) }
catch (e) { return [] }
<script src="less.js"></script>
<link rel="less" href="main.less" type="text/css">