Sandip Bhattacharya sandipb
- Sunnyvale, USA
- Sign in to view email
- https://blog.sandipb.net
View benchmark_load.py
import json | |
import ujson | |
from timeit import repeat | |
def decode_json(data): | |
json.loads(data) | |
def decode_ujson(data, precise=False): |
View test.py
from __future__ import print_function | |
import ujson, json | |
data = '{ "prod-lsg1": { "max_float": 0.0046288111 } }' | |
print("json dumps, w/o precise float: ", json.dumps(ujson.loads(data))) | |
print("json dumps, w/ precise float: ",json.dumps(ujson.loads(data, precise_float=True))) | |
print("ujson dumps, w/o precise float: ", ujson.dumps(ujson.loads(data))) | |
print("ujson dumps, w/ precise float: ",ujson.dumps(ujson.loads(data, precise_float=True))) |
View .bashrc
SOCK="/tmp/ssh-agent-$USER-screen" | |
SOCKPTR="$(readlink -f $SOCK 2> /dev/null)" | |
if [[ -z $SOCKPTR ]] || [[ ! -S $SOCKPTR ]] | |
then | |
echo -e "\e[31m\e[1mNo valid current tmux ssh-agent link\e[0m" | |
if [[ -n $SSH_AUTH_SOCK ]] && [[ -S $SSH_AUTH_SOCK ]] | |
then | |
rm -f $SOCK |
View gist:49f91868e83de9db70238dadfd0d80ca
### Keybase proof | |
I hereby claim: | |
* I am sandipb on github. | |
* I am sandipb (https://keybase.io/sandipb) on keybase. | |
* I have a public key ASC4KMgsBE9a3n9l9GI0InNtbh-SzM49e_m3sNt7jlAY4Qo | |
To claim this, I am signing this object: |
View main.go
package main | |
import ( | |
"bytes" | |
"flag" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"strconv" |
View csv_to_avro.py
#!/usr/bin/env python | |
import avro.schema | |
from avro.datafile import DataFileWriter | |
from avro.io import DatumWriter | |
import csv | |
import calendar | |
import time | |
schema = avro.schema.parse(open("weather.avsc").read()) |