Skip to content

Instantly share code, notes, and snippets.

View gopass2002's full-sized avatar

Seonghyun Jeong gopass2002

  • coupang
  • South Korea
View GitHub Profile
@gopass2002
gopass2002 / JAVA_HOME
Created October 16, 2014 02:44
JAVA_HOME setting (Mac OSX 10.5 or later)
$ vim .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
$ source .bash_profile
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
$ /usr/libexec/java_home -V
@gopass2002
gopass2002 / Haversin.py
Last active May 28, 2018 05:20
Haversine
import math
def distance(origin, destination):
lat1, lon1 = origin
lat2, lon2 = destination
radius = 6371 # km
dlat = math.radians(lat2-lat1)
dlon = math.radians(lon2-lon1)
a = math.sin(dlat/2) * math.sin(dlat/2) + math.cos(math.radians(lat1)) \
@gopass2002
gopass2002 / intsall-snappy.sh
Created May 7, 2015 11:32
install snappy codec
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <install path>"
exit
fi
prefix=${1}
tmpdir=${1}/tmp
platform=$(uname)
@gopass2002
gopass2002 / python-closures.py
Last active September 1, 2015 07:22 — forked from DmitrySoshnikov/python-closures.py
Understanding Python's closures
# "Understanding Python's closures".
#
# Tested in Python 3.1.2
#
# General points:
#
# 1. Closured lexical environments are stored
# in the property __closure__ of a function
#
# 2. If a function does not use free variables