This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clone = require('gulp-clone'); | |
gulp.task("default", function() { | |
var normal = gulp.src( destination + '*.png' ); | |
var retina = normal.pipe(clone()); | |
normal.pipe(makeSprites()) | |
.pipe(gulp.dest( imagesBase + '1x/' )); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const noop = arg => arg; | |
const combine = () => Array.from(arguments).reduce((a, b) => a.concat(b)); | |
const compact = arr => arr.filter(el => el); | |
const difference = () => { | |
var others = Array.from(arguments).slice(1).reduce((a, b) => a.concat(b)); | |
return arguments[0].filter(el => !others.some(exclude => el === exclude)); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var STYLE_ATTRIBUTE = 'TEXT-STYLE-NAME'; | |
var styleMatches = function (item, styleName) { | |
if (!item || item.attributes === undefined || item.attributes[STYLE_ATTRIBUTE] === undefined) { | |
return false; | |
} | |
return item.attributes[STYLE_ATTRIBUTE].match(styleName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
//module.exports = function(){ | |
var http = require("http"); | |
var optimist = require("optimist"); | |
var cheerio = require("cheerio"); | |
var path = require("path"); | |
var uglifyjs = require('uglifyjs'); | |
var uglifycss = require('uglifycss'); | |
var url = require('url'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.src(...) | |
.pipe(gutil.forwardErrors(pluginA())) | |
.pipe(gutil.forwardErrors(pluginB())) | |
.pipe(gutil.forwardErrors(pluginC())) | |
.on('error', function () { | |
throw new Error("Do not send to production!"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
(function(win, doc){ | |
if(win.addEventListener)return; //No need to polyfill | |
function docHijack(p){ doc[p]=(function(old){ return function(v){return addListen(old(v))}; })(doc[p]);} | |
function addEvent(on, fn, self){ | |
return (self = this).attachEvent('on' + on, function(e){ | |
var e = e || win.event; | |
e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------- Database section | |
// current version | |
var __versions__ = ['1.0.1','1.0.2','1.0.3']; | |
var __version__ = localStorage.getItem('db:version') | |
||__versions__[__versions__.length-1]; | |
function migrate_1_0_1() { | |
console.log('going into migrate_1_0_1'); | |
} | |
function migrate_1_0_2() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "FranceJS" | |
, "version" : "0.0.1" | |
, "dependencies" : { | |
"jslovers" : "*", | |
"parisjs" : "*", | |
"toulousejs" : "*", | |
"lyonjs" : "*", | |
"lillejs" : "*" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Chainable API for URIBuilder | |
var uri = new URLBuilder(logErrorHandler) | |
.parse('bad_url_format') | |
.addQueryParam('param','value') | |
.setPort('443') | |
.toString(); | |
function logErrorHandler(err, url_object){ | |
if('parse_error'===err.type) |