Skip to content

Instantly share code, notes, and snippets.

Avatar
🌱
Growing indie hacker

Vincent Voyer vvo

🌱
Growing indie hacker
View GitHub Profile
@vvo
vvo / offre d'emploi développeur JavaScript FTVEN.md
Last active Dec 16, 2015
Offre d'emploi développeur JavaScript chez France Télévisions Éditions Numériques
View offre d'emploi développeur JavaScript FTVEN.md

Offre d'emploi développeur JavaScript chez France Télévisions Éditions Numériques

France Télévisions Éditions Numériques recherche un développeur JavaScript confirmé ou au moins expérimenté avec une bonne soif d'apprendre.

Contexte

Vous rejoindrez l'équipe « player » qui s'occupe du développement du lecteur vidéo de tous les sites du groupe France Télévisions.

Vous pouvez voir un exemple de nos développements en production sur le site de culturebox.

@vvo
vvo / video-snapshots-sprites.sh
Created Jul 15, 2013
generate sprites of video snapshots
View video-snapshots-sprites.sh
sudo aptitude install ffmpeg
sudo aptitude install imagemagick
# fps=1 > every seconds
ffmpeg -i video.mp4 -f image2 -vf fps=fps=1 out%d.png
# horizontal sprite, resized at 30%
convert -resize 30% +append out*.png sprite-1-sec.png
# references:
@vvo
vvo / pre-push
Created Aug 2, 2013
Git pre-push hook to launch `NODE_ENV=test grunt test` and check for return code
View pre-push
#!/usr/bin/env node
var spawn = require('child_process').spawn;
var cmd = 'grunt';
var args = ['test'];
var options = {
stdio: 'inherit'
};
process.env.NODE_ENV = 'test';
spawn(cmd, args, options).on('exit', check);
@vvo
vvo / api-namespace.txt
Last active Dec 26, 2015
api namespace
View api-namespace.txt
How would you implement a js solution to set up an api namespace:
api.ns.method();
api.ns2.method2();
api.ns2.method3();
api.prop = 'hello';
where
ns.method and ns2.method2 can access all `api` properties/ns using `this`:
View nginx
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=2g;
proxy_set_header Host $host;
proxy_cache STATIC;
proxy_cache_valid 200 1m;
proxy_cache_key "$scheme$host$request_uri";
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
View nginx-ghost
server {
listen 80;
server_name myblog.com;
client_max_body_size 10M;
location ~* \.(jpg|jpeg|png|gif|ico|css|js|eot|woff)$ {
expires 10y;
proxy_pass http://localhost:2368;
}
View ghost-default-nginx
server {
listen 80;
server_name myblog.com;
client_max_body_size 10M;
location / {
proxy_pass http://localhost:2368/;
proxy_buffering off;
}
View ghost-performance-nginx-config.conf
# sets the proxy cache path location, max size 2g
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=2g;
# transfers the `Host` header to the backend
proxy_set_header Host $host;
# uses the defined STATIC cache zone
proxy_cache STATIC;
# cache 200 10 minutes, 404 1 minute, others status codes not cached
@vvo
vvo / simple webdriverjs example.js
Created Dec 15, 2013
simple webdriverjs example
View simple webdriverjs example.js
['chrome', 'firefox'].forEach(detectBrowser);
function detectBrowser(name) {
require('webdriverjs')
.remote({
desiredCapabilities: {
browserName: name
}
})
.init()
@vvo
vvo / rethinkdb.js
Created May 27, 2014
rethinkdb native driver
View rethinkdb.js
var async = require('async');
var r = require('rethinkdb');
var debug = require('debug')('rethinkdb');
// first get some warming data to insert
var warmMessages = require('./generate-messages.js')(10000);
var host = process.env.HOST || 'localhost';
// get real data to insert