Skip to content

Instantly share code, notes, and snippets.

View joujiahe's full-sized avatar

Johnson Chou joujiahe

View GitHub Profile
@joujiahe
joujiahe / launch-clean-chrome
Created November 3, 2014 08:18
Launch Chrome with a clean profile
# OSX
open -a "Google Chrome" --args --user-data-dir=/dev/null
# Linux
google-chrome --user-data-dir=/dev/null
# Windows
"C:\Users\username\AppData\Local\Google\Chrome\Application\chrome.exe" --user-data-dir=/dev/null
@joujiahe
joujiahe / terminal-shortcuts.txt
Last active August 29, 2015 14:05
Terminal Shortcuts
Control + L clear screen
Control + A cursor to start
Control + E cursor to end
Control + W delete a word
Control + U delete a line
Control + R autocomplete
@include text-overflow;
@include text-shadow(0 -1px 1px #21272B);
@include border-radius(2px, 2px);
@include border-bottom-left-radius(8px);
@include box-shadow(rgba(0, 0, 0, 0.05) 3px 3px 5px);
@include single-box-shadow(rgba(0, 0, 0, 0.075), 0, 0, 3px);
@include single-transition(opacity, 0.2s, linear, 0s);
@include background(linear-gradient($color-btn, darken($color-btn, 10%)));
@include background-image(linear-gradient(lighten($color-btn, 5%), darken($color-btn, 15%)));
@include background-image(none);
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/home/ngocdaothanh/opt/tsung-ws-plugin/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<clients>
<!-- Can't be IP -->
<client host="localhost" cpu="8"/>
<client host="t2" cpu="8"/>
<!--
<client host="t3" cpu="8"/>
<client host="t4" cpu="8"/>
@joujiahe
joujiahe / ulimit-ubuntu
Created March 27, 2014 18:03
increase ulimit on ubuntu
# /etc/security/ulimits/conf
* soft nofile 999999
* hard nofile 999999
# /etc/pam.d/su
session required pam_limits.so
# /etc/profile
ulimit -SHn 999999
@joujiahe
joujiahe / install-node.sh
Created March 27, 2014 17:43
ubuntu install nodejs
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
@joujiahe
joujiahe / fb-message.fql
Created February 6, 2014 11:28
FQL for getting Facebook messages and order by created time
SELECT body, source, viewer_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 1 AND me() IN (recipients)) ORDER BY created_time DESC
@joujiahe
joujiahe / fb-app-subscriptions
Created February 5, 2014 05:53
Facebook app subscription list
https://graph.facebook.com/<APP_ID>/subscriptions?access_token=<ACCESS_TOKEN>
@joujiahe
joujiahe / oop-inheritance.js
Created February 5, 2014 05:50
JavaScript Inheritance Patterns
// Constructor
function Animal(name) {
this.name = name;
}
Animal.prototype.say = function() { return 'Hi!' + this.name; };
function Dog(name) {
Animal.call(this, name);
}
Dog.prototype = new Animal();
@joujiahe
joujiahe / node-module.js
Created February 5, 2014 05:47
NodeJS Module Boilerplate
module.exports = (function () {
return {};
})();