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
var Mixin = require('Mixin'); | |
var Mixin1 = require('Mixin1'); | |
var Mixin2 = require('Mixin2'); | |
var Mixin3 = require('Mixin3'); | |
function MyCtor() { | |
} | |
Mixin.set(myCtor, Mixin1, Mixin2, Mixin3); |
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
module.exports = function xbbcode2html(str, options) { | |
var all = options.all || false; | |
var cleanup = options.cleanup || false; | |
var secure = options.secure || false; | |
var tags = [ | |
'span', 'kbd', 'var', 'del', 'ins', 'div', 'strong', 'em', 'dfn', 'cite', | |
'q', 'blockquote', 'p', 'br', 'a', 'ol', 'ul', 'li', 'abbr', 'acronym', | |
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'pre', 'address', 'img', 'tr', | |
'th', 'td', 'table', 'caption', 'thead', 'tfoot', 'tbody', 'dl', 'dd', 'dt', | |
'map', 'area', 'code', 'samp', 'sub', 'sup' |
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
function gRetain(options) { | |
var stream = new Stream.Writable({objectMode:true}) | |
, fileMap = {} | |
, timeout | |
, size = 0 | |
; | |
options.limit = options.limit || 0; | |
options.delay = options.delay || 300; |
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
#!/bin/bash | |
# Install the project | |
git clone [email protected]:ChtiJS/chtijs.francejs.org chtijs | |
cd chtijs | |
# Testing the Grunt build | |
git checkout master | |
npm install --quiet | |
time for a in {1..10}; do grunt dist; done |
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
module.exports = function(grunt) { | |
// Chargement des modules Grunt nécessaires | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-svgicons2svgfont'); | |
grunt.loadNpmTasks('grunt-svg2ttf'); | |
grunt.loadNpmTasks('grunt-ttf2eot'); | |
grunt.loadNpmTasks('grunt-ttf2woff'); | |
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
Installer/compiler NodeJS : http://nodejs.org | |
Puis dans la console : | |
# Karma runner | |
npm install -g karma | |
# Framework de test | |
npm install -g karma-mocha | |
npm install -g karma-chai | |
npm install -g karma-effroi |