I hereby claim:
- I am strboul on github.
- I am strboul (https://keybase.io/strboul) on keybase.
- I have a public key ASB-QR3015IubTjaSubzmM12zzDk8pvITKhfPqr_MJAXGwo
To claim this, I am signing this object:
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"os/exec" | |
"path/filepath" | |
"strings" |
# Run | |
# - python test.py | |
# - lsof test.log | |
import time | |
import os | |
FILE_NAME = "test.log" | |
def main(): |
import string | |
import random | |
message = "hello world from python" | |
# secret = ''.join(random.choices(string.ascii_uppercase + string.digits, k=100)) | |
secret = 'bob' | |
encrypted = ''.join([chr(ord(a) ^ ord(b)) for a, b in zip(message, secret)]) | |
decrypted = ''.join([chr(ord(a) ^ ord(b)) for a, b in zip(encrypted, secret)]) |
I hereby claim:
To claim this, I am signing this object:
# RStudio snippets | |
# https://support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets | |
# BASE | |
snippet lib | |
library(${0}) | |
snippet ifelse | |
ifelse(${1:condition}, ${2:yes}, ${3:no}) |
from pprint import pprint | |
def calc_growth(revenue, fixed_rate, years): | |
"""Calculate growth rate | |
revenue: Initial revenue. | |
fixed_rate: fixed rate to grow in a year. It's between 0 and 1. | |
years: number of years. | |
""" | |
init_revenue = revenue |
prepare_csv_data_import() { | |
schema_file="$(<yellow_tripdata.schema.template.sql)" | |
csv_files=( data/* ) | |
out="" | |
for csv_file in "${csv_files[@]}"; do | |
tablename="$(basename "${csv_file%.*}")" | |
str_schema="${schema_file//\{TABLENAME\}/${tablename}}" | |
str_copy_query="COPY ${tablename} FROM '/${csv_file}' DELIMITER ',' CSV HEADER;" | |
out="${out}\n\n${str_schema}\n${str_copy_query}" | |
done |
" vim-airline | |
Plug 'https://github.com/vim-airline/vim-airline' | |
Plug 'https://github.com/vim-airline/vim-airline-themes' | |
let g:airline_theme='bubblegum' | |
" powerline symbols | |
let g:airline_powerline_fonts=1 | |
" statusline settings |
// We parameterize ApiResponse to specify the type of its data field | |
interface ApiResponse<T> { | |
status: "success" | "failure"; | |
data: T; | |
} | |
interface User { | |
id: number | |
name: string |
const sleep = (ms) => { | |
return new Promise((resolve) => { | |
setTimeout(resolve, ms); | |
}); | |
}; | |
const queryDb = async (success) => { | |
await sleep(3000); | |
if (!success) { | |
throw new TypeError(); |