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

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

# declarations AST
# define DECLARATIONS
# include "Core.h"
# include "Types/Types.h"
# include <stdbool.h>
# undef DECLARATIONS
/*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 = {};
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.
}
@cloudhead
cloudhead / promise.js
Created February 22, 2010 18:26 — forked from tmpvar/promise.js
var events = require('events');
exports.Promise = function () {
exports.EventEmitter.call(this);
this._blocking = false;
this.hasFired = false;
this._values = undefined;
};
process.inherits(exports.Promise, events.EventEmitter);
This file lays out my planned open-source projects for the next year or so.
These projects are interdependent upon eachother in complex ways, hence the
complexity of this graph. The *overall*, eventual goal, is a set of my own
clients I can use with Google Wave, a web framework I *actually like*, and a
JavaScript development environment/ecosystem I can stomache.
This list is ordered bottom-up, and right-to-left. Items below and indented
another item *must* be completed (or have portions thereof completed) before
their parent item can be worked on.
var posix = require("posix");
var sys = require("sys");
var continuables = require('continuables');
function writeFile(filename, value, mode) {
if (typeof value !== "string") {
throw new Error('Value must be a string');
}
if (typeof mode === "undefined") {
mode = 0600;