Skip to content

Instantly share code, notes, and snippets.

View kissifrot's full-sized avatar

Philippe Villiers kissifrot

View GitHub Profile
@kissifrot
kissifrot / index.js
Created August 12, 2022 12:16
Basic nodejs ALB lambda with added Gateway IP information
const http = require('http');
const https = require('https');
const swIgnored = ["/css/", "/fonts/", "/images/", "/js/", "/scss/", ".bmp", ".css", ".csv", ".doc", ".docx", ".eot", ".gif", ".ico", ".ief", ".jpe", ".jpeg", ".jpg", ".js", ".json", ".less", ".map", ".m1v", ".mov", ".mp2", ".mp3", ".mp4", ".mpa", ".mpe", ".mpeg", ".mpg", ".otf", ".ott", ".ogv", ".pbm", ".pdf", ".pgm", ".png", ".ppm", ".pnm", ".ppt", ".pps", ".ps", ".qt", ".ras", ".rdf", ".rgb", ".rss", ".svg", ".swf", ".tiff", ".tif", ".tsv", ".ttf", ".txt", ".vcf", ".wav", ".webm", ".woff", ".woff2", ".xbm", ".xlm", ".xls", ".xml", ".xpdl", ".xpm", ".xwd"]; // in lower case
const swStatusHeader = "x-sw-status";
const swFallbackHeader = "x-sw-fallback";
const swClientIpHeader = "x-sw-client-ip";
// Read env vars
@kissifrot
kissifrot / gist:3f137e7e36c9e0b568e5
Created January 28, 2016 15:18 — forked from GavinJoyce/gist:4f81d0bf879dad6b203e
speeding up `npm install` by disabling the progress bar
with `react-native`:
npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 83.72s user 26.03s system 100% cpu 1:49.32 total
npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 199.30s user 27.32s system 91% cpu 4:08.29 total
--
@kissifrot
kissifrot / readme.md
Created January 27, 2016 15:44
Stylesheet finder usage

liste des classes de theme

git grep "\.t-" -- assets/src/stylesheets

liste des classes utilitaires

git grep ".u-" -- assets/src/stylesheets

liste des éléménts de composants (BEM)

git grep "__" -- assets/src/stylesheets
@kissifrot
kissifrot / .bash_profile
Last active October 29, 2015 15:38
My bash profile
########## CONFIGURATION ################
export HISTFILESIZE=4096 # Number of line to save
export HISTSIZE=1024 # Number of command to remember
export HISTCONTROL="ignoreboth" # dont save already entered commands, and command starting with a space (same as ignoredups:ignorespace)
### Editor
export EDITOR="vim"
export VISUAL=$EDITOR # screen oriented editor (as opposed to ed)
export FCEDIT=$EDITOR # edit command with vim
@kissifrot
kissifrot / .inputrc
Created October 29, 2015 15:21 — forked from isyara/.inputrc
Improve history with start y command name...
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@kissifrot
kissifrot / bash.bashrc
Created October 25, 2015 11:01
Bashrc file
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# if the command-not-found package is installed, use it