Skip to content

Instantly share code, notes, and snippets.

Working from home

Jaeger(黄杰) jae-jae

Working from home
View GitHub Profile
mozillazg / supervisord.service
Last active Aug 10, 2020 — forked from tonyseek/supervisord.service
install and configure supervisord on centos 7.
View supervisord.service
Description=supervisord - Supervisor process control system for UNIX
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
adamjimenez / gist:5917897
Created Jul 3, 2013
Generate thumbnails from video files using HTML5's video tag and canvas
View gist:5917897
//where you want your thumbnails to go
$thumbs_dir = 'uploads/thumbs/';
//this should be an array of video paths
$videos = array();
if( $_POST["name"] ){
// Grab the MIME type and the data with a regex for convenience
if (!preg_match('/data:([^;]*);base64,(.*)/', $_POST['data'], $matches)) {
ogrrd / dnsmasq OS
Last active Aug 11, 2020
Setup dnsmasq on OS X
View dnsmasq OS

Never touch your local /etc/hosts file in OS X again

NOTE this has been done properly by a guy here:

You should go and do that now, ignore all of this.

To setup your computer to work with *.dev domains, e.g., and so on, without having to add to your hosts file each time.


jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "";
parser.protocol; // => "http:"
parser.hostname; // => ""
parser.port; // => "3000"
parser.pathname; // => "/pathname/"; // => "?search=test"
parser.hash; // => "#hash"; // => ""
You can’t perform that action at this time.