Skip to content

Instantly share code, notes, and snippets.

@garmr
garmr / nginx.conf
Created September 27, 2016 17:48 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@garmr
garmr / grunt tips
Created January 11, 2016 09:06
grunt tips
# use configuration variables depending on environment
http://mindthecode.com/how-to-use-environment-variables-in-your-angular-application/
npm install grunt-ng-constant --save-dev
@garmr
garmr / bash tips
Created January 6, 2016 15:25
bash tips
# check php syntax on every "to be commited" files
for f in `git diff --cached --name-only --word-diff=porcelain`;do php -l $f;done;
# vim all files that contains a specific pattern
vim -p `fgrep -rl "pattern"`
@garmr
garmr / vim tips
Last active January 6, 2016 15:18
vim tips
# replacing tabs with spaces
ESC+:retab
@garmr
garmr / gist:f393ddb45b5b32dec0ac
Last active August 27, 2015 09:56 — forked from will83/gist:5920606
Fonction PHP permettant la conversion de Lambert93 à WGS84 (selon le fichier fourni par l'IGN).
<?php
function lambert93ToWgs84($x, $y){
$x = number_format($x, 10, '.', '');
$y = number_format($y, 10, '.', '');
$b6 = 6378137.0000;
$b7 = 298.257222101;
$b8 = 1/$b7;
$b9 = 2*$b8-$b8*$b8;
$b10 = sqrt($b9);
$b13 = 3.000000000;