Skip to content

Instantly share code, notes, and snippets.

View ophentis's full-sized avatar

Willy Tseng ophentis

View GitHub Profile
@ophentis
ophentis / gist:765ff5613f7a58888f47
Last active August 29, 2015 14:07
data-source-writer
var ridList = ["16b2d19e863218615007b009f9a104e42e2daf78","000a34f62b7a22d053b492eaad9bae921f034198","ff5606bcc1b311f893105107720ef0f273af071c","69b6899bb57ae4ceea4546fca9ae2bdc7870ea02","9ab2807b97ba11d79c4f36ca50e09c1f9f489fc5","b638939016874e00a5dbaf81e1ce905a8cc5710e","90b6434b023c78a701dc192aa9f3a901c7073343","4eb06515fefa45b1b2313d7f984ba92e46766283","bc4814915b3e18b32711ae410a7ecbc1776f15a6","cb3db7cd85137e38af9f252467ceab74bbd21fbb","f2e20b39d881ebdd8244789f17c9339409962eeb","2e77867a51691af9c690b87d31325c5b42a489c7","bb163ab53288857996a3b679aaf572c84435e530","97a2cca048f6170e6e6dfd02ad57ecabe1ccf77f","e0e87f21a25651b230cc1d4acd2c98bcfa24f7fa","d0eabe36e806f4fcb8906234b41a72a19a1721e3","06ea166ecd4870b9df75f5273e8938034a24e807","80d98adb5fed9384b9e71de861efd6ab5c7df78c","9abe475e024c88e571276a9f6650900865d6e87d","d7a829e51f91fc506f9467814b939a74e929112f","80420d6d6884be529ee038fdc3fee32f715b0c2f","7d9c3c639073feb1f47dad9c22e9887f901c13f4","ee8cd20b7d7a3f194cb5063e238ae356616752fe","1bb4499515f3088b991
sudo python ~/Documents/dnsproxy.py -s 8.8.8.8
@ophentis
ophentis / mongodb-cmd
Created October 4, 2014 06:31
mongodb commands
mongod --config /usr/local/etc/mongod.conf
@ophentis
ophentis / gist:92d4cab77e0bf1c2c19d
Created September 19, 2014 03:09
build qcachegrind from github repository
git clone git://anongit.kde.org/kcachegrind
cd kcachegrind/qcachegrind
qmake -spec 'macx-g++'; make
@ophentis
ophentis / gist:5c18bb548d69d83e6176
Created September 19, 2014 02:44
rsync folders
time rsync -aOvz sandbox-02:/var/benchmark/ ~/benchmark
@ophentis
ophentis / gist:4c34ae4ec5cbbff9aa9a
Created September 16, 2014 12:01
flush memcache
echo 'flush_all' | nc localhost 11211
@ophentis
ophentis / parseLink
Created September 12, 2014 03:52
http link header parsing
@ophentis
ophentis / gist:9152346
Created February 22, 2014 11:24
js random hex color
(Math.random().toString(16) + '000000').slice(2, 8)
@ophentis
ophentis / gist:7890752
Created December 10, 2013 13:44
array dimension for javascript
//
// [1].dim() == 1
// [1,2].dim() == 1
// [[1]].dim() == 2
// [[1,2,3],4,[5,6,7],[8,9,0]].dim() == 2
// [[1,[2]],3,[[4,5],6,[7,8]]].dim() == 3
//
Array.prototype.dim = function dim() {
return this.reduce(function(a,b) {
@ophentis
ophentis / gist:6774758
Created October 1, 2013 06:56
For a given date, get the ISO week number
/* For a given date, get the ISO week number
*
* Based on information at:
*
* http://www.merlyn.demon.co.uk/weekcalc.htm#WNR
*
* Algorithm is to find nearest thursday, it's year
* is the year of the week number. Then get weeks
* between that date and the first day of that year.
*