Skip to content

Instantly share code, notes, and snippets.

View koorukuroo's full-sized avatar
🎯
Focusing

Kyunghoon Kim koorukuroo

🎯
Focusing
View GitHub Profile
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
#!/usr/bin/env python2
# coding: utf-8
from __future__ import print_function
import sys
import re
import json
import urllib
from colorama import init, Fore, Back, Style
URL = 'http://csearch.naver.com/dcontent/spellchecker.nhn'
# coding: utf-8
import re
import urllib
from bs4 import BeautifulSoup
class MelonSong(object):
ARTIST_REGEXP = re.compile(r'.*goArtistDetail.*')
ALBUM_REGEXP = re.compile(r'.*goAlbumDetail.*')
SONG_REGEXP = re.compile(r'.*playSong.*')
NUMBER_PARAM_REGEXP = re.compile(r'[\'\",(\s](\d+)[\'\",)]')
#!/usr/bin/env python2
# coding: utf-8
from __future__ import print_function
import os
import sys
from wand.image import Image
DIMENSIONS = {
'OSX': [
('icon_16x16.png', 16),
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def epsg_4326_to_900913(lon, lat):
x = lon * 20037508.34 / 180
y = (math.log(math.tan((90 + lat) * math.pi / 360)) / (math.pi / 180)) * (20037508.34 / 180)
return x, y
def epsg_900913_to_4326(x, y):
lon = x * 180 / 20037508.34
lat = (360 / math.pi) * math.atan(math.exp(y * math.pi / 20037508.34)) - 90
return lon, lat
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import urllib2
# This script uses HEAD requests (with fallback in case of 405)
# to follow the redirect path up to the real URL
# (c) 2012 Filippo Valsorda - FiloSottile
# Released under the GPL license
--- networkx-1.5/networkx/drawing/nx_pylab.py 2011-06-04 09:45:38.000000000 +0900
+++ nx_pylab.py 2011-10-01 01:48:06.000000000 +0900
@@ -21,7 +21,8 @@
# All rights reserved.
# BSD license.
-__all__ = ['draw',
+__all__ = ['set_fontproperties',
+ 'draw',
'draw_networkx',
@koorukuroo
koorukuroo / setup_selenium.sh
Last active June 7, 2016 01:21 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@koorukuroo
koorukuroo / GibbsLDA.py
Created August 12, 2016 03:07 — forked from ChangUk/GibbsLDA.py
Collapsed Gibbs sampler for Latent Dirichlet Allocation
#-*- coding: utf-8 -*-
"""
GIBBS SAMPLING IMPLEMENTATION FOR LATENT DIRICHLET ALLOCATION (2003)
IMPLEMENTED BY CHANG-UK, PARK
DATA FORMAT: "DocID\t WordID\t FREQUENCY\n"
"""
import sys
import random