Skip to content

Instantly share code, notes, and snippets.

View wandroll's full-sized avatar
🙃

Wandrille Verlut wandroll

🙃
View GitHub Profile
@wandroll
wandroll / README.md
Last active March 24, 2023 18:01 — forked from jmhobbs/README.md
Create scrolling text gifs for Slack with local fonts

Makes little scrolly text jiffs in Flywheel colors.

Prerequisites

  • imagemagick brew install imagemagick
  • gifsicle brew install gifsicle
  • u r on a mac
  • To list the available local fonts to you run identify -list font
@wandroll
wandroll / CustomPromise.js
Last active May 11, 2018 09:29
Custom Promise
export class CustomPromise {
constructor (executor) {
if (typeof executor !== 'function'){
throw new Error('You must pass a function')
}
// Etat de notre promesse
let _state = State.PENDING;
this.setState = setter(_state)
this.getState = getter(_state)
@wandroll
wandroll / genMapper.js
Created December 13, 2017 20:48
A generic mapper ( when you need to execute several mappings on dataset based on simple rules)
/**
* A generic String value mapper
* @param {String} value - the value to mapp
* @param {Array <{re: Regexp, val: {*}}>} mappings - a list of regexp with their mapped Value
* @param {*} defaultValue
*/
function genMapper ( value, mappings , defaultValue){
const foundValue = mappings.find(({re, val}) => str.match(re))
return foundValue ? foundValue.value : defaultValue
}
@wandroll
wandroll / FlagHelper.js
Last active December 13, 2017 20:27
How to pass additional flags to NPM scripts
const DEFAULT_FLAG = '--options='
/**
* Allow to pass additional flag in command line
* @param {String} flag - optionnal flag used in command line
*
* Flags can be passed :
* - either when defining the script in package.json :
* "myscript": "somecommand param --options=opt1"
* - when calling the script adding '--'
@wandroll
wandroll / data.service.js
Created April 17, 2016 13:04
Data Service Factory using $q
/**
* dataservice Factory
* @namespace Factories
* @author Wandrille Verlut <wandrille.verlut@gmail.com>
*/
(function() {
'use strict';
angular
.module('app')