Skip to content

Instantly share code, notes, and snippets.

View marcpicaud's full-sized avatar

Marc Picaud marcpicaud

View GitHub Profile
- repo: git://github.com/marcpicaud/addons-pre-commit
sha: master
hooks:
- id: php-lint-all
files: \.(php)$
- id: php-cs
files: \.(php)$
args: [--standard=PSR2 -p]
- id: php-cbf
file: \.(php)$
SET SESSION sql_mode = '';
SET NAMES 'utf8';
CREATE TABLE `accessory` (
`id_product_1` int(10) unsigned NOT NULL,
`id_product_2` int(10) unsigned NOT NULL,
KEY `accessory_product` (`id_product_1`,`id_product_2`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `address` (
const express = require('express');
const bodyParser = require('body-parser');
const amqp = require('amqplib');
const q = 'tasks';
var app = express();
app.use(bodyParser.json());
// Publisher
@marcpicaud
marcpicaud / index.js
Last active December 20, 2016 15:23
// Pour faire des requêtes HTTP
const request = require('request');
// Pour gérer le filesystem local
const fs = require('fs');
// Headers de la requête HTTP
const headers = {
'Origin': 'http://www.fiv.fr',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': '*/*',
@marcpicaud
marcpicaud / script.pl
Created November 6, 2019 11:40
Discover commit pattern
#!/usr/bin/perl
# usage:
#
# git log --author="Marc Picad" --format="%H %ai" | perl script.pl
#
use strict;
use warnings FATAL => 'all';
use utf8;
@marcpicaud
marcpicaud / install-gdal.sh
Created July 1, 2020 20:36 — forked from rastermanden/install-gdal.sh
install gdal with python amazon AMI
sudo yum-config-manager --enable epel
sudo yum install gdal-python
sudo yum -y update
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L http://download.osgeo.org/gdal/2.2.4/gdal-2.2.4.tar.gz | tar zxf -
cd gdal-2.2.4/
./configure --prefix=/usr/local --with-python
make -j4
sudo make install
@marcpicaud
marcpicaud / download-typekit-fonts.js
Created December 5, 2022 10:50 — forked from maryo/download.js
Typekit font downloader
const https = require('https');
const fs = require('fs');
// https://github.com/majodev/google-webfonts-helper/blob/master/server/logic/conf.js
const FORMAT_USER_AGENTS = {
// see http://www.dvdprojekt.de/category.php?name=Safari for a list of sample user handlers
// test generation through running grunt mochaTest:src
eot: 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)',
woff: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0',
// must serve complete woff2 file for one variant (no unicode range support yet!)