Skip to content

Instantly share code, notes, and snippets.

View julien-f's full-sized avatar

Julien Fontanet julien-f

View GitHub Profile
@julien-f
julien-f / index.html
Created August 18, 2014 15:42
Polymer
<!DOCTYPE html>
<html>
<head>
<!-- bower i -S Polymer/platform -->
<script src="bower_components/platform/platform.js"></script>
<!-- bower i -S Polymer/polymer -->
<link rel="import" href="bower_components/polymer/polymer.html">
</head>
<body>
@julien-f
julien-f / examples.js
Created September 5, 2014 07:23
Lazy initializer useful for lazy requires.
var lazyInit = require('./lazy-init');
var promisify = lazyInit(function () {
return require('bluebird').promisify;
});
var readFile = lazyInit(function () {
return promisify(require('fs').readFile);
});
var mapPlus = require('./map-plus');
var mapValuesPlus = require('./map-plus').values;
mapPlus([1, 2, 3], function (value) {
var square = value * value;
var cube = square * value;
this.push(square, cube);
});
// [1, 1, 4, 8, 9, 27]
@julien-f
julien-f / README.md
Last active July 8, 2016 22:02
CSR generation

CSR generation with OpenSSL

The following command lines avoid specifying parameters as much as possible hoping that your version of OpenSSL will make the best choices for the current time and that it will allow this recipe to stay up-to-date as long as possible.

Private key

Generate a 4096 bits long key using the RSA algorithm.

> openssl genrsa -out key.pem 4096
@julien-f
julien-f / example.js
Last active August 29, 2015 14:07
Easy (sync & async) stream filter & mapper.
'use strict';
//====================================================================
var from2Array = require('from2Array');
var nicePipe = require('nice-pipe');
var filterStream = require('./filter-stream');
var mapStream = require('./map-stream');
@julien-f
julien-f / README.md
Last active August 29, 2015 14:07
Karma + Mocha + Browserify
> npm i -D karma karma-bro
> node_modules/karma/bin/karma init
Which testing framework do you want to use ?
Press tab to list possible options. Enter to move to the next question.
> mocha

Do you want to use Require.js ?
This will add Require.js plugin.
Press tab to list possible options. Enter to move to the next question.
@julien-f
julien-f / gulpfile.js
Last active August 29, 2015 14:07
Gulp 4
'use strict';
// ===================================================================
var SRC_DIR = __dirname + '/src'
var DIST_DIR = __dirname + '/dist'
var PRODUCTION = process.argv.indexOf('--production') !== -1
// ===================================================================
@julien-f
julien-f / README.md
Last active August 29, 2015 14:07
Techs to test

Techs to test

  • Baobab - Data tree with cursors (great with React).
  • Broccoli - Fast, reliable HTML build tool
  • Brunch - Ultra-fast HTML5 build tool
  • dasdash - Light option parsing library (vs minimist?)
  • duo - Package manager for the front-end
  • eslint - Pluggable linter for JavaScript (instead of jshint)
  • Flux - Architecture for building user interfaces
  • hapi.js - Framework similaire à Express
@julien-f
julien-f / global.md
Last active August 29, 2015 14:07
Favorites packages
# telnet HOST [PORT = 23]
telnet() (
# Open a bidirectional TCP connection.
exec 3<> /dev/tcp/"$1"/"${2:-23}"
# Pipe 3 to stdout.
cat <&3 &
# Pipe stdin to 3.
cat >&3