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
// less
foo, bar {
color: black;
lol, &:cat {
font: none;
> a, b {
color: red;
}
########################
# wp2toto #
# by Joseph Weissman #
########################
# config
author = "user"
wpfile = "user_blog_export.xml"
outdir = "../articles/"
var F = function () {};
F.name // ''
F.name = "foo";
F.name // ''
<script src="less.js"></script>
<link rel="less" href="main.less" type="text/css">
//
// Recursively traverse a hierarchy, returning
// a list of all relevant .js files.
//
function paths(dir) {
var paths = [];
try { fs.statSync(dir) }
catch (e) { return [] }
input ! click {
delay: 1ms;
}
! fadeOut {
time: 100ms;
}
input#search ! tokenize {
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.
}
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);
}
}
});
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 ){
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'
});
})