- grunt task that watches over
node_modules
directory in a repo and copies the directory on change- Could be also be done with nodemon or something else
- Create a node client for it (because it is awesome)
CSS as a queue
node_modules
directory in a repo and copies the directory on change
CSS as a queue
/node_modules |
REM Large portion from http://www.timespace.org/2006/09/20/custom-windows-cmd-prompt/ | |
REM TODO: Text colors | |
REM TODO: Git branch conditionals | |
set PROMPT=%USERNAME% at %COMPUTERNAME% in $P $_$$ |
// Modification of https://github.com/milanvrekic/JS-humanize/blob/master/humanize.js | |
/*! | |
intword | |
Converts a large integer to a friendly text representation. Works best for numbers over 1 million. | |
100 -> 100 | |
1200 -> 1.2k | |
2589000 -> 2.5m | |
*/ | |
function sliceToFirstDecimal(number) { |
// THIS FILE IS A JADE FILE -- THE EXTENSION IS TO FORCE LANGUAGE INTERPRETATION | |
// Set up of dependencies and bindings | |
{ | |
// // Specify any dependencies (e.g. partials must be defined) | |
// 'require': ['mvc!v/nav!v/main'], | |
// Backbone style event bindings -- INSIDE the view/template markup | |
// I like this because it is so fool-proof and quite portable | |
'events': { | |
'submit .validate-form': 'submit', | |
'click .submitBtn': 'submit' |
function Console() { | |
// Create a div and textarea for the console | |
var div = document.createElement('div'), | |
output = document.createElement('div'), | |
textarea = document.createElement('textarea'), | |
button = document.createElement('button'), | |
that = this; | |
// Style the div | |
div.style.cssText = 'position: fixed; top: 0; left: 0; background: white; border: 1px solid black; z-index: 10000;'; |
module.exports = function (grunt) { | |
// Initial configuration | |
grunt.initConfig({ | |
// Download external resources | |
curl: { | |
// Twitter Bootstrap | |
bootstrap: { | |
src: 'http://twitter.github.com/bootstrap/assets/bootstrap.zip', | |
dest: 'tmp/bootstrap.zip' | |
} |
This is a guide for how we manage our version control.
Improving partials (inspired by Jade’s mixins) [07/15] -- Inline’d partials as functions is what we really want: <%= Builder(‘partialView’, app) %> The current setup is too watered down to have any real power. Unfortunately, if we want to use Jade mixins globally, they must be defined globally as such which kills the ability for segmentation and re-use in other parts (a rose by any other name). Otherwise, it is local which is the same as our current state. So fucking simple yet so fucking powerful and easy to miss.
Making this happen: In every Builder invocation, include a new object property:
{
// I have decided to rename Builder to partial for semantics
// You must be on http://www.jshint.org/docs/ | |
var nameElts = $$('.name'), | |
names = nameElts.map(function (elt) { | |
return elt.textContent || elt.innerText; | |
}), | |
nameProps = names.map(function (name) { | |
return ' ' + name + ': false'; | |
}), | |
retStr = '{\n' + nameProps.join(',\n') + '\n}'; | |
console.log(retStr); |