Skip to content

Instantly share code, notes, and snippets.

var fs = require('fs');
var gulp = require('gulp');
var Handlebars = require('handlebars');
var globby = require('globby');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
// var transform = require('vinyl-transform');
var through = require('through2');
spacify('hello world') // => 'h e l l o w o r l d'
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
@gipp
gipp / gist:7123883
Created October 23, 2013 18:22
Some super-simple event-emitter functions
function createEmitter(object) {
// a place to hold callbacks for event subscribers
object._eventStore = {};
object.on = function(eventName, fn) {
if (!this._eventStore[eventName]) {
this._eventStore[eventName] = [];
}
this._eventStore[eventName].push(fn);
};
require 'fileutils'
output = {}
output['junk'] = []
Dir.foreach(source) do |f|
if f != '.' and f != '..' and f != '.gitignore'
output['junk'].push(f)
end
end
................................................................................
..........................................................................|.....
..........................................................................|.....
.........................................................................dMb....
.........................................................................MMM....
........................................................................dMMMb...
........................................................................NMMMN...
...............ddddm....................................................MMMMM...
.......h..mmh..MMMMM...d..........h.....................................MMMMN...
......mMm.MMm..MMMMMh..MNNd....mMMMN..h................mmh....mm........MMMMN...
................................................................................
..........................................................................|.....
..........................................................................|.....
.........................................................................MMM....
........................................................................dMMMb...
........................................................................NMMMN...
...............ddddm....................................................MMMMM...
.......h..mmh..MMMMM...d..........h.....................................MMMMN...
......mMm.MMm..MMMMMh..MNNd....mMMMN..h................mmh....mm........MMMMN...
NNN..MMMMNMMMNNMMMMMMMhMMMm.NNmMMMMM.hMNNhddNMNmmmm.hNNMMN...hMMd.......MMMMM...
var mq = document.createElement('style');
mq.textContent = "@media (min-width: 768px) {body {background: salmon;}}";
document.getElementsByTagName('head')[0].appendChild(mq);
@gipp
gipp / gist:5506051
Last active December 16, 2015 22:19
CATS. Oh yeah, there are (at least) 3 things wrong with this that make the console.log on line 9 not work.
var Kitten = function(name) {
this.name = name;
var mouseCount;
this.init = function() {
this.stalk(function(count) {
mouseCount = count;
});
console.log('You found a kitten! Congrats! Its name is ' + this.name + ' and it caught ' + mouseCount + ' mice');
};
var ANIMATE = (function(s) {
return 'WebkitAnimation' in s ||
'MozAnimation' in s ||
'msAnimation' in s ||
'Animation' in s;
}(document.body.style));