Skip to content

Instantly share code, notes, and snippets.

@soyuka
soyuka / ezseed
Created March 26, 2014 08:15
Ezseed2 apache
<VirtualHost *:80>
ServerAdmin infos@soyuka.me
ServerName localhost
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@soyuka
soyuka / misc.sh
Created April 4, 2014 07:17
pm2 misc.sh
#!/usr/bin/env bash
SRC=$(cd $(dirname "$0"); pwd)
source "${SRC}/include.sh"
cd $file_path
echo -e "\033[1mRunning tests:\033[0m"
var express = require('express');
var app = express();
var reg = /^[a-z]+$/;
app.use(require('body-parser')());
var param = function(req, res, next, val) {
return val.match(reg) ? next() : next(new Error(val + ' is not a valid param'))
}
// Callback hell
do.this(function(callback) {
then.do.that(function() {
then.end(function() {
callback()
})
@soyuka
soyuka / gist:73b792e8666b8563d338
Created June 15, 2014 20:17
PM2 vagrant config
https://github.com/Unitech/pm2/issues/289#issuecomment-42900019
var http = require('http');
http.createServer(function(req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8020);
process.on('exit', function() {
console.log('exit');
});
@soyuka
soyuka / .nanorc
Created June 22, 2014 22:40
.nanorc debian
include /usr/share/nano/asm.nanorc
include /usr/share/nano/fortran.nanorc
include /usr/share/nano/man.nanorc
include /usr/share/nano/ocaml.nanorc
include /usr/share/nano/ruby.nanorc
include /usr/share/nano/awk.nanorc
include /usr/share/nano/gentoo.nanorc
include /usr/share/nano/mgp.nanorc
include /usr/share/nano/patch.nanorc
include /usr/share/nano/sh.nanorc
rm -rf frames && mkdir frames && ffmpeg -i pm2-logs.mov -vf scale=-1:480 -r 10 frames/ffout%03d.png && convert -delay 5 -loop 0 frames/ffout*.png pm2-logs.gif
@soyuka
soyuka / remove_notif.sh
Last active August 29, 2015 14:03
Remove notification center / update notifications os x
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist