I hereby claim:
- I am afuntw on github.
- I am afuntw (https://keybase.io/afuntw) on keybase.
- I have a public key ASAqRqWMw9V33NOduv-D8ppUi_2z8UU1DinOLhTLLPyacwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| download_from_gdrive() { | |
| file_id=$1 | |
| file_name=$2 | |
| # first stage to get the warning html | |
| curl -c /tmp/cookies \ | |
| "https://drive.google.com/uc?export=download&id=$file_id" > \ | |
| /tmp/intermezzo.html | |
| # second stage to extract the download link from html above |
| /* | |
| * input = "apple AND orange"; re = "(?=apple)(?=orange)" | |
| * input = "apple OR orange"; re = "apple|orange" | |
| */ | |
| function queryParser (input) { | |
| var re = '' | |
| input = input.split(' ') | |
| for (var i=0; i<input.length; ++i) { | |
| if (input[i] !== 'AND' && |
| class bcolors: | |
| HEADER = '\033[95m' | |
| OKBLUE = '\033[94m' | |
| OKGREEN = '\033[92m' | |
| WARNING = '\033[93m' | |
| FAIL = '\033[91m' | |
| ENDC = '\033[0m' | |
| BOLD = '\033[1m' | |
| UNDERLINE = '\033[4m' |
| #List unique values in a DataFrame column | |
| pd.unique(df.column_name.ravel()) | |
| #Convert Series datatype to numeric, getting rid of any non-numeric values | |
| df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
| #Grab DataFrame rows where column has certain values | |
| valuelist = ['value1', 'value2', 'value3'] | |
| df = df[df.column.isin(value_list)] |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <cstdlib> | |
| using namespace std; | |
| vector< vector<int> > transform2IntVecVec (vector<string> vs){ | |
| vector< vector<int> > vvI; |
| #!/bin/bash | |
| echo To show a string within ALL files in a given directory. Updated: 2016-01-10 | |
| if [ $# -eq 0 ] | |
| then | |
| echo Usage: $0 [directory] [string] | |
| else | |
| echo Showing all \'$2\' under directory \'$1\' ... | |
| grep -R -n --exclude-dir=node_modules --exclude-dir=lib --color=always "$2" "$1" | |
| fi |
Follow the code style below
// comment
exports.youFunc = function(...){}usage:
./tuneExports.py file1 file2 file3| #!/bin/bash | |
| echo "Recording memory usage to memoryLog..." | |
| date >> memLog.csv | |
| echo "USER,%CPU,%MEM,STIME,COMMAND" >> memLog.csv | |
| while true; do | |
| ps -ax -o user,pcpu,pmem,stime,cmd --sort -rss | head -n 6 >> tmpLog | |
| while read -r user cpu mem stime cmd; do | |
| if [ $user != "USER" ]; then | |
| echo $user,$cpu,$mem,$stime,$cmd >> memLog.csv |