View gist:fa626bef810d1fe1024b
var subscribersModel = {
users: [
{
'id': '1asdf',
'activeSubscriptions': ['monthly', 'gold'],
'gender': 'm',
'age': '31',
'username': 'CowboyWayne'
},
{
View js-closure
var multiplyByNumber = function (x) {
return function(y) {
// this nested anonymous function references
// parent 'x' arg variable
return x * y;
}
}
/**
* multiplyBy5 below is a function because multiplyByNumber returns a function.
View opacity.less
/* .bg-opacity() = the workhorse background opacity mixin. takes 2 sets of
* RGB plus opacity making a grand total of 7 params.
* Usage: .alert-box{ .bg-opacity(0,0,0,255,255,255,.75); }
*/
.bg-opacity (@r1: 0, @g1: 0, @b1:0, @r2: 0, @g2: 0, @b2:0, @opacity: .5) {
// convert RGB to HEX for IE mixin
// notice ~ escaping and ` for JS evaluation
@topHex: ~`((1 << 24) + (@{r1} << 16) + (@{g1} << 8) + @{b1}).toString(16).slice(1)`;
@bottomHex: ~`((1 << 24) + (@{r2} << 16) + (@{g2} << 8) + @{b2}).toString(16).slice(1)`;