Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address 1EsdADticFeK4GjLUAkXysYW3atmQ3KyKq https://explorer.blockstack.org/address/1EsdADticFeK4GjLUAkXysYW3atmQ3KyKq
@bitpshr
bitpshr / fixedGrid.less
Last active December 25, 2015 13:19
Simple fixed-width LESS mixin
@gridWidth: 1170;
@gutterWidth: 30;
@numberOfColumns: 12;
@columnWidth: (@gridWidth - ((@numberOfColumns - 1) * @gutterWidth)) / @numberOfColumns;
.row {
width: 1170px;
margin: 0 auto;
overflow: hidden;
}
define([
'intern!object',
'intern/chai!assert',
'require'
], function (registerSuite, assert, require) {
var request,
url = 'http://localhost/Projects/intern-examples/dojo-example';
registerSuite({
name: 'Todo (functional)',
<snippet>
<content><![CDATA[
define([
${1:'dojo/_base/declare'}
], function (${2:declare}) {
return declare(${3});
});
]]></content>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Button test</title>
<link rel="stylesheet" href="dijit/themes/claro/claro.css">
</head>
<body>
<button id="button" type="button" data-dojo-type="dijit/form/Button">My Button</button>
// register someTask, which is either an array of
// tasks or an empty array based on someCondition
grunt.registerTask('someTask', (function () {
return someCondition ? [ 'submodules' ] : [];
})());
// someTask is then used multiple times throughout
// the rest of the Gruntfile.
grunt.registerTask('default', [ 'someTask', 'watch:stylus' ]);
grunt.registerTask('test', [ 'someTask', 'intern-init', 'intern' ]);
{
all: [1, 5, 13, 2, 6, 7, 3, ...],
owner: [5, 4, 8, 2, 13, 5, 3, ...]
}
var scale = parseFloat(height - 1) / max;
var render = function (v, i){
v *= scale;
c.fillRect(i * width, height - v, width - 1, v);
};
var i, len;
for(i=0, len=data.owner.length; i<len; i++){
render(data.owner[i], i);
}