This codepen is used to be embedded and show how to send message to its parent page
/** | |
* Split a path to a property into its keys | |
* (property names or array indexes) | |
* @example | |
* splitPath("persons[0].address.street") => ["persons", "0", "address", "street"] | |
* @param {String} path | |
* @return {Array} | |
*/ | |
export const splitPath = (path = "") => path.split(/[,[\].]+?/).filter(Boolean); |
/** | |
* Build a promise that resolve in `ms` milliseconds with the response provided | |
* NOTE: response may be a function, whose evaluation would be delayed by ms | |
* @param {Number} ms The delay to wait before resolving the Promise | |
* @param {Any} response The data to return after ms. | |
* @return {Promise} | |
*/ | |
export const delay = (ms, response) => | |
new Promise((resolve) => | |
setTimeout( |
#!/bin/bash | |
if [ ! -f "playlist.m3u" ]; then | |
ls *.mp3 -v -1 > playlist.m3u | |
fi | |
mplayer -playlist ./playlist.m3u |
#!/usr/bin/env node | |
/** | |
* babel-register is all that is needed to require es6 module transparently | |
*/ | |
require("babel-register")({ | |
presets: ["env"] | |
}); | |
const { someNamedExport } = require("./es6-module"); | |
const someDefaultExport = require("./es6-module.js").default; // Notice how we must access the `default` property to access the default export |
/** | |
* Wait that functions calls run below a delay of @ms | |
* to trigger the function @fn | |
* @param {Function} fn - the function to debounce | |
* @param {Number} [ms=250] - the delay (in ms) between each function call | |
* @param {Object} [ctx] - An optional context to bind the function to | |
* @return {Function} that will execute only after the specified delay between calls has elapsed | |
*/ | |
export const debounce = (fn, ms = 250, ctx) => { | |
return function(...args) { |
25 ans d'expérience en SSIIs, startups et freelance comme Chef de Projet, Lead Dev ou Architecte Système.
Tout en veillant continuellement à me tenir à jour sur les derniers outils, langages, mon intérêt s'étend aujourd'hui de plus en plus à toutes les étapes du Design Produit (Product Design, Service Design Thinking).
Ces méthodologies ont comme objectif de toujours garder en ligne de mire un objectif simple : créer la meilleure expérience utilisateur (UX) possible pour son produit.
Cela consiste notamment à faire des recherches sur les problèmes récurrents des utilisateur, les modéliser sous forme de personas, imaginer les nouveaux parcours utilisateur pour qu'ils accomplissent leurs tâches, et s'assurer de ne livrer que des fonctionalités utiles puis de mesurer l'impact des livrables pour continuer à améliorer de manière incrémentale le produit.
/** | |
* Partition an array on the result of a boolean test | |
* @return {Array[Array]} where the first array contains the element that passed the test | |
*/ | |
Array.prototype.partition = (test) => this.reduce( | |
(accumulator, val) => { | |
accumulator[test(val)?0:1] = val | |
return accumulator | |
})([[], []]) | |
} |
/** | |
* jQuery plugin to convert form fields to a plain JS Object | |
* @usage var contactForm = $("form.contact").formData(); | |
* @returns {'fieldName': 'fieldValue', (...)} | |
*/ | |
$.fn.formData = function() { | |
var data = {}, | |
keyValues = this.serializeArray(); | |
$.each(keyValues, function() { | |
var field = this.name, val = this.value; |