Skip to content

Instantly share code, notes, and snippets.

View myok12's full-sized avatar

Ohad Kravchick myok12

  • Google Inc.
  • Sunnyvale, CA
View GitHub Profile
@myok12
myok12 / add_package_info.sh
Created May 10, 2018 00:59
Add package_info.java files to project
find . -name '*.java' | grep -v "\/target\/" | grep java | rev | cut -f "2-" -d "/" | rev | sort | uniq | xargs -I{} sh -c 'echo "$1" | grep -o "java\/.*" | cut -f "2-" -d "/" | tr "/" "." | awk '"'"'{print "package "$1";"}'"'"' > "$1/package-info.java" ' -- {}
git status | grep package-info | xargs -I{} sh -c 'echo "@javax.annotation.ParametersAreNonnullByDefault" | cat - "$1" > /tmp/tttt ; mv /tmp/tttt "$1"' -- {}
@myok12
myok12 / out_1_non_200_POST_curl_against_CDN.txt
Last active May 8, 2018 21:57
Single Non 200 POST call
[$] curl --verbose --silent --http1.0 --keepalive --header Connection: keep-alive --request POST https://groupon.com/api/auth?token=INCORRECT_very_very_secret_key --data username=test@groupon.com&password=password
* Trying 100.100.100.100...
* TCP_NODELAY set
* Connected to groupon.com (100.100.100.100) port 80 (#0)
> POST /api/auth?token=INCORRECT_very_very_secret_key HTTP/1.0
> Host: groupon.com
> User-Agent: curl/7.54.0
> Accept: */*
> Connection: keep-alive
#!/bin/sh
# build.sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.69"
TESSERACT_LIB="`pwd`/tesseract-3.01"
IOS_BASE_SDK="6.0"
IOS_DEPLOY_TGT="5.1"
coords = (
(41.2863,-73.78689),
(41.2864,-73.78690),
(41.2869,-73.78698),
)
from math import floor
def gen_hash(coords):
pro_lat = floor(coords[0]*1000.0)