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
for ((i=0; i<$(git stash list | wc -l); i++)); do; echo {$i} && git stash show stash@{$i} | grep .py;done; |
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
# homebrew | |
mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew | |
# install system packages | |
brew install python libxml2 mysql libmemcached openssl swig jpeg redis elasticsearch | |
# start mysql server | |
mysql.server start | |
# install virtualenv/virtualenvwrapper |
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
/** | |
* @param {desc} True for descending order | |
*/ | |
var sort = function(array, key, desc) { | |
array.sort(function(e1, e2) { | |
var greater = 1, | |
smaller = -1; | |
if (desc) { | |
greater = -1; | |
smaller = 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
function walk(path, action) { | |
function list_dirs(path) { | |
var list = fs.readdirSync(path); | |
var dirs = []; | |
var files = []; | |
for(var i = 0; i < list.length; i++) { | |
var file_path = path + '/' + list[i]; | |
var fd = fs.openSync(file_path, 'r'); | |
var is_dir = fs.fstatSync(fd).isDirectory(); | |
fs.closeSync(fd); |
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
from commbadge views: | |
--------------------- | |
* l10n | |
* z | |
* urls | |
* requests | |
* nunjucks | |
* notification |
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
&:before { | |
content: ""; | |
position: absolute; | |
left: -50px; | |
top: 15px; | |
z-index: 1000; | |
width: 0; | |
height: 0; | |
border-top: 25px solid transparent; | |
border-right: 50px solid white; |
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
import csv | |
subjects = ['PD734', 'CI752', 'CI736', 'CI731'] | |
busy = [] | |
days = ['MON', 'TUE', 'WED', 'THURS', 'FRI', 'SAT'] | |
def build_tt_array(csv_file): | |
csvreader = csv.reader(open(csv_file, 'r'), delimiter=',', quotechar='"') | |
times = csvreader.next() |
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
#!/usr/bin/env python | |
from cyberoam import sendLoginRequest | |
password_list = '77uu88' | |
"""('66ggyy', | |
hhgg55 | |
ddrr55 | |
'ttgg44', | |
'66ggyy', |
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
BASE_URL="http://hub.browserstack.com/wd/hub" | |
res=`curl -X POST -u $AUTH_NAME:$AUTH_KEY -d '{"desiredCapabilities":{"browser": "firefox"}}' $BASE_URL/session` | |
sessionId=`echo $res | sed -n 's/.*\"sessionId\":\"\([^"]*\).*/\1/p'` | |
# Open URL | |
res=`curl -X POST -u $AUTH_NAME:$AUTH_KEY -d '{"url":"http://google.com"}' $BASE_URL/session/$sessionId/url` | |
# Get title | |
res=`curl -X GET -u $AUTH_NAME:$AUTH_KEY $BASE_URL/session/$sessionId/title` | |
title=`echo $res | sed -n 's/.*\"value\":\"\([^"]*\).*/\1/p'` |
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
for i in `adb devices | awk '{print $1}' | sed 's|List||' | xargs`; do adb -s $i reboot; done |
OlderNewer