Skip to content

Instantly share code, notes, and snippets.

View tilap's full-sized avatar
🏠
Working from home

Tilap tilap

🏠
Working from home
View GitHub Profile
@tilap
tilap / useWindowSize.js
Last active December 13, 2019 15:21
A simple react hook to get window size and listen to changes.
import { useCallback, useState, useEffect } from 'react';
const isBrowser = typeof window !== 'undefined';
const getSize = () => {
if (isBrowser) {
return {
width: window.innerWidth,
height: window.innerHeight,
};
@tilap
tilap / chrome-bookmarks
Created April 24, 2019 07:54 — forked from selvan/chrome-bookmarks
Chrome extension to export all bookmarks
//manifest.json
{
"name": "bookmark-search-export",
"version": "1.0",
"manifest_version": 2,
"description": "This extention will dump all bookmarks",
"browser_action": {
"default_icon": "icon.png"
},
"background": {
@tilap
tilap / gulpfile.js
Created July 10, 2015 08:38
Find unused package in your nodeJS app with gulp task.
var depcheck = require('depcheck');
var path = require('path');
gulp.task('unusedPackages', function() {
var options = {
withoutDev: false,
ignoreDirs: ['lib', 'locales', 'logs', 'public'],
ignoreMatches: ['gulp-*']
};
@tilap
tilap / fill-array.js
Last active September 22, 2017 17:38
Filling an array
// To get [1, 2, 3, 4, 5, 6, ..., 900]
const start = 1;
const end = 900;
const ids = Array.apply(null, { length: end - start}).map(Number.call, (num) => Number(num) + start);
@tilap
tilap / githubrepo.sh
Last active May 14, 2016 18:34
BASH: Command to create a git repo from CLI
# USAGE: githubrepo name-of-the-repo
githubrepo() {
USERNAME=tilap
if [ $# -ne 1 ]; then
echo "You must provide the name of the repo"; \
exit; \
fi
local REPO=$1
echo "Create repo $REPO on github";

Deep Dive into Grid Layout Placement

Une revue complète des différentes méthodes de positionnement offertes par les mises en page des grilles CSS.

Ceci est la traduction française de l'article "Deep Dive into Grid Layout Placement" par Manuel Rego (@regocas), publié le 1er Février 2016. Toutes les images et extraits de code viennent de l'article original avec la permission de l'auteur.

Voila quelques mois que, à travers mon travail à Igalia, je tente de terminer les derniers détails de l'implementation du placement des éléments au sein d'une mise en page de type CSS Grid dans Blink. En résumé, il s'agissait principalement de travailler sur ces 2 choses:

  • Supporter d'abord les grilles implicites avant les grilles explicites. Cela afin qu'une grille puisse ajouter des pistes si besoin pas seulement dans la direction ou la grille grqndie (en général vers la dr
@tilap
tilap / Makefile.sh
Last active December 2, 2015 13:27
Fontello in a project
# Some Makefile commands and var to make use of fontello in a web project and use the
# Fontello website to directly setup and custom your custom fonticon
#
# See french explanation on http://tilap.net/integrer-fontello-dans-son-workflow-dev-pour-gerer-facilement-ses-icones-applicatifs/
# Local / env var
FONT_DIR ?= ./src/browser/fonts/fontello
FONTELLO_HOST ?= http://fontello.com
FONT_TOKENFILE ?= .fontello
@tilap
tilap / gulptask-replace-back-front.js
Last active December 1, 2015 09:31
Gulp: replace {BACK}...{/BACK} by nothing
/**
* Put some code section in command before moving them
*
* @example
* ```
* let start = 1;
* // {BACK}
* let backendvar = 'red is dead';
* // {/BACK}
* let end = 1;
@tilap
tilap / pre-push
Last active August 29, 2015 14:22
Git Pre-push hook to avoid pushing on some branch or ask confirmation for some other branches
#!/bin/bash
## CONFIG
# Pattern of branch name you won't be allowed to push force
NOPUSHFORCE_BRANCHES_PATTERN="^(dev|release-*|patch-*)"
# Pattern of branch name you won't be allowed to push
NOPUSH_BRANCHES_PATTERN="^(master)"
# Pattern of branch name that will ask to confirm before pushing
CONFIRM_BRANCH_PATTERN="^(master|production)"

Keybase proof

I hereby claim:

  • I am tilap on github.
  • I am tilap (https://keybase.io/tilap) on keybase.
  • I have a public key whose fingerprint is A577 6CA4 0F42 B237 97EC 9574 EA7B 00C4 C3A3 F5B3

To claim this, I am signing this object: