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
@cloudhead
cloudhead / gist:1591794
Created January 10, 2012 23:08
LESS 1.2.0 CHANGELOG

LESS 1.2.0 CHANGELOG

  • mixin guards
  • new function percentage
  • new color function to parse hex color strings
  • new type-checking stylesheet functions
  • fix Rhino support
  • fix bug in string arguments to mixin call
  • fix error reporting when index is 0
  • fix browser support in webkit and IE

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

LESS 1.2.0

Now available on http://lesscss.org and NPM.

This release opens up the powerful branching capabilities of mixin guards and pattern-matching as an alternative to conditional statements.

In trying to stay as close as possible to the declarative nature of CSS, LESS has opted to implement conditional execution via guarded mixins, in the vein of @media query feature specifications:

@cloudhead
cloudhead / gist:1522576
Created December 27, 2011 02:41
Why I Don't Write Web Apps

Why I Don't Write Web Apps (if I can help it)

This is what happens when I try to pick a language.

Note: If I didn't think it was possible to create a development environment without any of these issues (which I consider "major" for the most part), I would not have written this list.

C/C++

  • NOTHNX.

Node.js

# declarations AST
# define DECLARATIONS
# include "Core.h"
# include "Types/Types.h"
# include <stdbool.h>
# undef DECLARATIONS
@cloudhead
cloudhead / gist:967157
Created May 11, 2011 19:38
LESS v1.1.0 - What's new

LESS v1.1.0 - What's new

@arguments special variable:

  .box-shadow () { -webkit-box-shadow: @arguments }

string interpolation:

content: "hello @{var}"; // replaced with value of @var

@cloudhead
cloudhead / gist:844802
Created February 26, 2011 01:01
Why 4 space tabs are better than two space tabs.
// 2 space tab
if (this.value) {
this.value++;
}
// 4 space tab
if (this.value) {
this.value++;
}
var vm = require('vm');
var context = {
data: 123,
run: function () {
return this.data;
}
}, result;
From 13f75861414b07aa44345c549a04e0850a3cc2cf Mon Sep 17 00:00:00 2001
From: cloudhead <alexis@cloudhead.io>
Date: Mon, 21 Feb 2011 19:31:01 -0500
Subject: [PATCH] fix process.on edge case with signal event
When adding a listener for a signal event, removing it, and
adding it back again, it triggers a condition with an
undefined variable.
---
src/node.js | 2 +-
@cloudhead
cloudhead / gist:837942
Created February 21, 2011 23:51
Fix for process.removeListener(signal)
From 40ca5c222a853f20654e059e8ccf551b4f610874 Mon Sep 17 00:00:00 2001
From: cloudhead <alexis@cloudhead.io>
Date: Mon, 21 Feb 2011 18:49:32 -0500
Subject: [PATCH] fix process.removeListener with signal events
---
src/node.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/node.js b/src/node.js