This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert to MP4 video | |
ffmpeg -i output.mov -s 1280x720 -b 2000k -ab 128k -vcodec libxvid -acodec libmp3lame -sws_flags +bitexact final.mp4 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Refer: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delaying_only_some_traffic | |
#Refer: http://www.bomisofmab.com/blog/?p=100 | |
#Refer: http://drija.com/linux/41983/simulating-a-low-bandwidth-high-latency-network-connection-on-linux/ | |
#Setup the rate control and delay | |
sudo tc qdisc add dev lo root handle 1: htb default 12 | |
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 56kbps ceil 128kbps | |
sudo tc qdisc add dev lo parent 1:12 netem delay 200ms | |
#Remove the rate control/delay | |
sudo tc qdisc del dev lo root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
projector = new THREE.Projector(), | |
p3D = new THREE.Vector3(25, 15, 9), | |
p2D; | |
p2D = projector.projectVector(p3D, camera); | |
p3D = projector.unprojectVector(p2D, camera); | |
//need extra steps to convert p2D to window's coordinates | |
p2D.x = (p2D.x + 1)/2 * window.innerWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ find . -name '.svn' -exec rm -R -f '{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Can use a short revision id (3ec090f) in place of master to export a specific revision | |
git archive --format zip --output ../zipfile.zip master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using vim | |
:%s/-\(.\)/\U\1/g | |
# Explain: Search for pattern -(.) and turn uppercase the first group \U\1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Realistic CSS3 Waterfall | |
* Author: Thanh Tran | |
* License: MIT | |
* Tutorial: http://blog.int3ractive.com/2012/04/tutorial-realistic-waterfall-with-css3.html | |
* Image courtesy: http://wolffanticy.webs.com/waterfallcavepack.htm | |
*/ | |
/* Container with the static waterfall background image */ | |
.waterfall { |
OlderNewer