Skip to content

Instantly share code, notes, and snippets.

View dino-su's full-sized avatar

Dino Su dino-su

View GitHub Profile
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
# ssh tunnel
alias gateway='ssh -D4444 [email protected]'
" enable syntax highlighting
if has("syntax")
syntax on
endif
" remember the last edited position
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
autocmd BufRead,BufNewFile *.jade setlocal ft=jade
endif
@dino-su
dino-su / avconv_examples.sh
Last active June 18, 2016 10:09 — forked from romuloceccon/avconv_examples.sh
avconv command lines to reduce video size
# https://trac.ffmpeg.org/wiki/Encode/H.264
# https://trac.ffmpeg.org/wiki/Encode/AAC
# -map 0 -c copy: copy all remaining streams
# -pix_fmt yuv420p: be compatible with most players
# high quality video, high quality audio
avconv -i input.mov -map 0 -c copy -c:v libx264 -preset veryslow -pix_fmt yuv420p -crf 17 -c:a libfdk_aac -vbr 4 output.mov
# high quality *compatible* full-hd video, high quality audio
@dino-su
dino-su / README.md
Last active March 4, 2016 06:17
Running Monkey in client-server model.

Setup port forwarding

$ adb forward tcp:1080 tcp:1080

Start the monkey server

$ adb shell monkey --port 1080

Run Commands

$ telnet localhost 1080
tap 150 200
@dino-su
dino-su / README.md
Last active January 7, 2016 07:32
Selenium Bootstrap

Test with Firefox

$ BROWSER=firefox mocha selenium.js

Test with Chrome

$ BROWSER=chrome mocha selenium.js

### Performance
# The values for the following options are dependent on the system's hardware
# and Internet connection speed. To find the optimal values read:
# Optimize Your BitTorrent Download Speed.
min_peers = 40
max_peers = 52
min_peers_seed = 10
max_peers_seed = 52
@dino-su
dino-su / comp.js
Created December 19, 2015 09:27
EventEmitter in composition way.
'use strict';
var EventEmitter = require('events').EventEmitter;
var bot = {
sayHi: function(name) {
console.log('hi ' + name);
},
emitter: new EventEmitter()
};
@dino-su
dino-su / README.md
Last active December 16, 2015 07:13
NODE_ENV

$ node index.js // local url

$ NODE_ENV=heroku node index.js // heroku url