Skip to content

Instantly share code, notes, and snippets.

View trongthanh's full-sized avatar
🎈
Keep calm and code on

Thanh Tran trongthanh

🎈
Keep calm and code on
View GitHub Profile
@trongthanh
trongthanh / dabblet.css
Created May 15, 2013 08:11
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.box {
width: 200px;
height: 200px;
background: rgba(255,0,255, 0.2);
}
@trongthanh
trongthanh / dabblet.css
Created March 17, 2013 06:53
Flex-box playground
/**
* Flex-box playground
*/
body { font: 2em sans-serif; }
.s1 { font-size: 1em; }
.s2 { font-size: 2em; }
.s3 { font-size: 1.5em; }
.box {
background: #ffcccc;
@trongthanh
trongthanh / dabblet.css
Created May 10, 2012 06:42
Animated 3D Stereo Images with CSS3
/**
* Animated 3D Stereo Images with CSS3
* Author: Thanh Tran (int3ractive.com)
*/
.image1 {
background: url(http://labs.int3ractive.com/javascript/effects/stereo-images/img/DSC_0192.jpg) no-repeat;
width: 512px;
height: 769px;
}
@trongthanh
trongthanh / gist:2258994
Created March 31, 2012 03:34
Convert dash-separated properites to camel case ones
# Using vim
:%s/-\(.\)/\U\1/g
# Explain: Search for pattern -(.) and turn uppercase the first group \U\1
@trongthanh
trongthanh / gist:2048765
Created March 16, 2012 06:21
Git commands to pull remote and merge with current branch
# save current changes (if any) to stash
git stash save
# pull remote changes to local
git pull origin
# apply stash and try auto merge
git stash pop
# OR
git stash apply
@trongthanh
trongthanh / gist:1823062
Created February 14, 2012 03:09
export a git revision
# Can use a short revision id (3ec090f) in place of master to export a specific revision
git archive --format zip --output ../zipfile.zip master
@trongthanh
trongthanh / clear_svn.sh
Created October 18, 2011 06:16
Search for .svn folders and remove them. (Remove all subversion metadata folders)
$ find . -name '.svn' -exec rm -R -f '{}' \;
@trongthanh
trongthanh / gist:954886
Created May 4, 2011 07:43
Create Flash context menu
public function createContextMenu(versionString: String): void {
if (!contextMenu) contextMenu = new ContextMenu();
contextMenu.hideBuiltInItems();
var versionMenu: ContextMenuItem = new ContextMenuItem("v." + versionString, false, false);
contextMenu.customItems = [versionMenu];
}
@trongthanh
trongthanh / gist:819927
Created February 10, 2011 04:05
Log my computer IP to a file shared on Ubuntu One
# log my computer IP to a file shared on Ubuntu One
/sbin/ifconfig $1 | grep "inet addr" | gawk -F: '{print $2}' | gawk '{print $1}' > "/home/thanh/Ubuntu One/office_ip"
@trongthanh
trongthanh / gist:799860
Created January 28, 2011 05:05
convert video to mp4 format
# convert to MP4 video
ffmpeg -i output.mov -s 1280x720 -b 2000k -ab 128k -vcodec libxvid -acodec libmp3lame -sws_flags +bitexact final.mp4