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 / script.js
Last active August 29, 2015 14:15
Add a class to <body> depending on the screen touchable capability.
/*
* Add a class to <body> depending on the screen touchable capability
* Usage: require('script')();
*/
/* global document, window, navigator */
module.exports = function() {
var notTouchableClassname = 'not-touchable',
@tilap
tilap / site.xml
Last active August 29, 2015 14:15
Expire and header mods Apache rules to improve cache on statics files. Apply 864000 seconds cache on images, icons, html, javascript and css files. To insert in apache Virtualhost.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 180 seconds"
AddType image/x-icon .ico
AddType text/css .less
ExpiresByType image/jpg "access plus 864000 seconds"
ExpiresByType image/jpeg "access plus 864000 seconds"
ExpiresByType image/png "access plus 864000 seconds"
ExpiresByType image/gif "access plus 864000 seconds"
ExpiresByType image/ico "access plus 864000 seconds"

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:

@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)"
@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 / 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 / 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 / install.sh
Created January 29, 2016 08:23
Share your git hooks in a project: basic script to install them all
#!/bin/bash
# Basic script to set custom project hook and share it with other developpers
# original script from http://stackoverflow.com/questions/3462955/putting-git-hooks-into-repository/3464399#3464399
#
# cd [path-of-the-script]
# . install.sh
#
# Folders usecase
# /.git

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 / 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";