Skip to content

Instantly share code, notes, and snippets.

View isthatcentered's full-sized avatar

Edouard isthatcentered

  • Lille, remote
View GitHub Profile
@isthatcentered
isthatcentered / recursive_list.twig
Last active May 3, 2020 22:13
Recursive list template for Twig using recursive macros. Compatible Twig 2.x // for grandpas or hipsters using twig in js (hello friends :D )
{% macro list(items, class) %}
<ul class="{{class}}">
{# Iterating over each direct items #}
{% for item in items %}
<li>
<a href="">{{item.name}}</a>
{# If an item has children #}
{% if item.children %}
php -S localhost:3000 -t ./
// Drupal 8 default modules setup
drush dl admin_toolbar field_collection conditional_fields devel ctools image_widget_crop crop pathauto token module_filter simple_sitemap linkit focal_point features config_update replicate replicate_ui search_kint seo_checklist lazyloader image_popup checklistapi vardumper twig_tweak google_analytics google_analytics_report metatag
@isthatcentered
isthatcentered / styleguide.config.js
Created October 6, 2017 13:06
React styleguidist config
const path = require( 'path' )
module.exports = {
components: 'src/**/*.component.js', // use this file extension to filter components
require: [
path.join( __dirname, 'styleguide.js' ), // Custom js for styleguide
'bootstrap/dist/css/bootstrap.css' // Custom css for styleguide
],
styles: {
Playground: { // for component PlaygroundRenderer
@isthatcentered
isthatcentered / kill.txt
Created October 6, 2017 13:19
Kill process
ps ax | grep mongod
kill -2 <processId>
@isthatcentered
isthatcentered / Bootstrap 4 breakpoint checker
Last active December 4, 2017 07:01
Bootstrap 4 breakpoint checker
body:after {
content: 'xs';
display: block;
padding: 5px 10px;
position: fixed;
z-index: 9999;
right: 0;
top: 0;
color: black;
@isthatcentered
isthatcentered / debounce.js
Created November 18, 2017 15:44
ES6 debounce function
/**
* debounce
* Ensures a function won't be called before a defined amout of time
* Ex:
* on window resize, ensure a function won't be called
* until the user stopped resizing window for {time param}
*
* @param { function } fn Callback to be executed after debounce
* @param { int } time Time to wait before function execution
* @return {function(...[*])}
@isthatcentered
isthatcentered / gulpfile.js
Last active January 26, 2018 17:23
gulp sass browser-sync
/**
* NPM dependencies to install
* (npm i -D gulp gulp-sass ... )
*/
const gulp = require( "gulp" ),
path = require( "path" ),
sass = require( "gulp-sass" ),
sourcemaps = require( "gulp-sourcemaps" ),
autoprefixer = require( "gulp-autoprefixer" ),
browserSync = require( "browser-sync" ).create() // Local server
Timer*
Idle*
start->Running
Running
reset->Idle
tick-> SpecifiedTimeElapsed?
# Transient state define system’s logic without dropping into code
SpecifiedTimeElapsed?