Skip to content

Instantly share code, notes, and snippets.

Arthur Mialon ArthurMialon

Block or report user

Report or block ArthurMialon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ArthurMialon
ArthurMialon / listDependencies.js
Last active May 16, 2016
Create a tree, a list or a graph of all packages and sub-packages from your npm modules
View listDependencies.js
const {compose, map, flatten, prop} = require('ramda');
const path_to_node_modules = './node_modules/';
const tabs = num => new Array(num).map(item => '\t ').join(' ');
export const getPackage = name => require(`${path_to_node_modules}${name}/package.json`);
const getDependencies = plugin => {
return [
plugin,
tree(getPackage(plugin))
];
@ArthurMialon
ArthurMialon / package_scripts.json
Last active Jan 19, 2016
Base npm scripts for application using sass with ES6 and Dploy
View package_scripts.json
{
"scripts": {
"test": "mocha",
"serve": "http-server . -a 127.0.0.1 -p 4444",
"dev": "mkdir dist && npm run build && npm run watch",
"watch": "npm run watch::js & npm run watch::scss",
"build": "npm run build::js && npm run build::sass",
"dploy::staging": "dploy staging",
"dploy::prod": "dploy production",
"watch::js": "watchify src/*.js -o dist/app.js -dvt [ babelify --presets [ es2015 ] ]",
@ArthurMialon
ArthurMialon / middleware_system.js
Last active Apr 7, 2016
A really simple middleware system that can be use everywhere.
View middleware_system.js
// See more about my Cycle.js
// https://gist.github.com/ArthurMialon/aaed187b1b3bd567fde3
const Cycle = (array, i) => {
i = i || 0;
return {
next() {
i = (i + 1 == array.length) ? 0 : (i + 1);
return Cycle(array, i);
},
value: array[i]
@ArthurMialon
ArthurMialon / cycle.js
Last active Feb 15, 2017
Cycle function for Array JavaScript
View cycle.js
/**
* Cycle Array
* @param {array} a simple array
* @param {iterator} key [optional (Default: 0)]
*/
const Cycle = (array, i=0) => ({
get next() {
return Cycle(array, ((i + 1 == array.length) ? 0 : (i + 1)));
},
get previous() {
You can’t perform that action at this time.