Skip to content

Instantly share code, notes, and snippets.

View joujiahe's full-sized avatar

Johnson Chou joujiahe

View GitHub Profile
@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 / 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 / git-tree.sh
Created December 26, 2013 01:51
Show git tree in command line
git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit"
@joujiahe
joujiahe / top_10_shell_commands.sh
Created June 27, 2013 13:41 — forked from hanksudo/top_10_shell_commands.sh
Show your top 10 shell commands
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
@joujiahe
joujiahe / git-autocompletion-for-mac.sh
Created April 9, 2013 08:58
Git auto-completion for mac computer.
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
echo "source ~/.git-completion.bash" >> ~/.bash_profile
@joujiahe
joujiahe / bootstrap.css
Created November 6, 2012 16:56
Bootstrap relative fix.
// For block below content issue.
body {
padding-top: 60px;
}
@media (max-width: 979px) {
body {
padding-top: 0px;
}
}
@joujiahe
joujiahe / gitolite-project.sh
Created September 28, 2012 07:58
Get gitolite project's name in post-receive hook.
#...
path=`pwd`
project_name=${path/"$HOME/repositories/"/""}
#...
@joujiahe
joujiahe / shell-type.sh
Created September 4, 2012 07:18
Show the current shell type.
which sh | xargs ls -l
@joujiahe
joujiahe / make-arm.sh
Created September 4, 2012 07:15
Make arm device.
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm xxxx_config
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm
@joujiahe
joujiahe / gmail-smtp.py
Created August 30, 2012 04:35
Using python SMTP through gmail to send mail with multiple receiver.
#!/usr/bin/python
import sys
import smtplib
subject = sys.argv[1]
body = sys.argv[2]
recipients = sys.argv[3]
gmail_user = '[email protected]'
gmail_pwd = 'password'