The following will minify your assets with grunt each time a generation write completes.
- Install Dependencies
var express = require('express'); | |
var sys = require('sys'); | |
var oauth = require('oauth'); | |
var app = express.createServer(); | |
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY"; | |
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET"; | |
function consumer() { |
require 'json' | |
# JSON parser tag, creating map for use in jekyll markdown | |
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com) | |
# Released under APL 2.0 | |
# usage: {% jsonball varname from TYPE PARAM %} | |
# | |
# where TYPE is one of {data,var,file,page}, described below |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
The following will minify your assets with grunt each time a generation write completes.
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
'use strict'; | |
module.exports = function(grunt) { | |
// Override process.stdout to log the name+args of the current task before | |
// every logged line. | |
var hooker = require('hooker'); | |
var newline = true; | |
hooker.hook(process.stdout, 'write', function(str) { | |
var prefix = grunt.task.current.nameArgs; | |
if (newline && prefix && str !== '\n') { |
function settleAll(array) { | |
return when(array, function(array) { | |
var i, len, results; | |
results = []; | |
for(i = 0, len = array.length; i < len; i++) { | |
if(i in array) { | |
results[i] = when(array[i], null, identity); | |
} |
var assert = require('chai').assert; | |
var when = require('when'); | |
var def1 = when.defer(); | |
function getProm() { | |
return def1.promise; | |
} |