Skip to content

Instantly share code, notes, and snippets.

View joujiahe's full-sized avatar

Johnson Chou joujiahe

View GitHub Profile
@joujiahe
joujiahe / notifications.fql
Created February 5, 2014 05:37
Facebook FQL for getting user's notifications
SELECT title_text, updated_time FROM notification WHERE recipient_id=me() ORDER BY updated_time DESC
@joujiahe
joujiahe / realtime-user-fields
Created February 5, 2014 05:40
Facebook Realtime Update query for user's fields
object=user&fields=about,about_me,affiliations,allowed_restrictions,birthday,birthday_date,books,checkin_deal_claims,contact_email,current_location,education,education_history,email,email_hashes,events,family,feed,first_name,has_added_app,hometown,hometown_location,hs_info,interests,is_app_user,last_name,likes,link,locale,location,meeting_for,meeting_sex,movies,music,name,notes_count,online_presence,photos,pic,picture,pic_https,pic_with_logo,pic_big,pic_big_https,pic_big_with_logo,pic_small,pic_small_https,pic_small_with_logo,pic_square,pic_square_https,pic_square_with_logo,political_views,profile_blurb,profile_update_time,profile_url,proxied_email,quotes,relationship_status,religion,gender,sex,significant_other_id,status,statuses,timezone,television,tv,username,verified,wall_count,website,work,work_history,friends,platform,privacy,blocked,ip_optout
@joujiahe
joujiahe / node-module.js
Created February 5, 2014 05:47
NodeJS Module Boilerplate
module.exports = (function () {
return {};
})();
@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 / 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 / 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 / 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 / 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
<?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"/>
@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);