Skip to content

Instantly share code, notes, and snippets.

View lionelB's full-sized avatar
🪂
Working from home

Lionel lionelB

🪂
Working from home
View GitHub Profile
@lionelB
lionelB / package.json
Created November 26, 2015 17:20 — forked from anonymous/package.json
browserify+stylus+babel+hotreload
{
"scripts": {
"test": "mocha -g",
"start": "babel-node server.js",
"prestart": "npm run build",
"build": "npm-run-all 'build:*'",
"build:js": "cross-env NODE_ENV=production browserify -t babelify -t envify src/app.js > static/build.js",
"postbuild:js": "uglifyjs static/build.js -o static/build.js",
"build:css": "cross-env NODE_ENV=production stylus css/main.styl -o static",
"watch": "npm-run-all --parallel 'watch:*'",
@lionelB
lionelB / svg.matrix.js
Last active November 25, 2015 15:45
helper functions to handle svg transform matrix
function toRad(angle) {
return angle*Math.PI/180;
}
function computePositionFromMatrix(m, el, angle) {
const rad = toRad(angle);
const dim = el.getBBox();
const tx = m.e - dim.width/2 + Math.cos(rad)*dim.width/2 - dim.height/2*Math.sin(rad);
const ty = m.f - dim.height/2 + dim.width/2*Math.sin(rad) + dim.height/2*Math.cos(rad);
" Base16 Default (https://github.com/chriskempson/base16)
" Scheme: Chris Kempson (http://chriskempson.com)
" GUI color definitions
let s:gui00 = "151515"
let s:gui01 = "202020"
let s:gui02 = "303030"
let s:gui03 = "505050"
let s:gui04 = "b0b0b0"
let s:gui05 = "d0d0d0"
@lionelB
lionelB / .colors.csv
Last active October 3, 2015 14:15 — forked from avillafiorita/.colors.csv
change osx terminal colors and font from the command line
LightPink1 #ffbdc5 255 189 197 {65535 48573 50629}
pink4 #9d777f 157 119 127 {40349 30583 32639}
pink3 #d7a3ad 215 163 173 {55255 41891 44461}
pink2 #f2b9c4 242 185 196 {62194 47545 50372}
pink1 #ffc3cf 255 195 207 {65535 50115 53199}
HotPink4 #9e4f75 158 79 117 {40606 20303 30069}
HotPink3 #d878a1 216 120 161 {55512 30840 41377}
HotPink2 #f383b5 243 131 181 {62451 33667 46517}
HotPink1 #ff87c1 255 135 193 {65535 34695 49601}

Ce qu’il faut :

  • Pour 6 gua bao
    • ✎ 300 g de farine de blé T65 ( ou T55 )
    • ✎ 150 ml d’eau tiède
    • ✎ 15 g de sucre de canne
    • ✎ 5 g de levure sèche instantanée du boulanger
    • ✎ 1 pincée de sel
    • ✎ 1 càs d’huile d’olive
  • Tofu à la citronnelle
  • ✎ 2 tiges de citronnelle
function reactView(req, res, next) {
Router.run(routes, req.url, function (Handler) {
// Content is the route handler,
// which then handles all the routing
// and kicks back HTML with React.renderToString
var title = "Lumographe";
if (req.url !== "/") {
var project = store.findByUrl(req.url);
if (project) {
title += " | " + project.name;
@lionelB
lionelB / urlParams.js
Created October 27, 2014 21:30
extract url params
//Since http://devdocs.io/dom/urlutils.searchparams is not already bake!
//the url to parse
var url = "https://toto.com/truc/?param1=yo&param2=toto&tutu=titi";
// Create a HTMLAnchorElement
var a = document.createElement('a');
// Lazy dev let the browser do the hard job and parse the url
a.href = url;
@lionelB
lionelB / replace.js
Created April 15, 2014 20:53
multiple search/ replace using regexp et Array.reduce
var replaceMap = [
{token:/pattern1/, value:"value1"},
{token:/pattern2/, value:"value2"},
];
return replaceMap.reduce(function(memo, item){
return memo.replace(item.token, item.value);
}, "pattern1 or patten2 will be replaced");
@lionelB
lionelB / gist:9034494
Created February 16, 2014 13:50
echo task
grunt.registerTask('echo', function(){
fs.createReadStream('./package.json',{encoding:'utf-8'})
.pipe( process.stdout );
});
@lionelB
lionelB / diff.js
Created February 13, 2014 16:20
underscore object differences
function diff(A,B,prop){
var getProp = _.property(prop);
var eq = function(itemA, itemB){
return getProp(itemA) === getProp(itemB);
};
return _.filter(A, function(itemA){
return ! _.some(B, _.partial(eq,itemA) );
});