Skip to content

Instantly share code, notes, and snippets.

View koorukuroo's full-sized avatar
🎯
Focusing

Kyunghoon Kim koorukuroo

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>monty_hall_simulation</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style type="text/css">
/*!
*
* Twitter Bootstrap
@koorukuroo
koorukuroo / GoLang-http-json-return.go
Last active July 19, 2018 04:27
GoLang http JSON Return Simple Example
package main
import(
"net/http"
"encoding/json"
)
func handler(w http.ResponseWriter, r *http.Request) {
datas := make(map[int]Foo)
for i := 0; i < 10; i++ {
@koorukuroo
koorukuroo / jwt_validator.py
Created June 25, 2018 06:02 — forked from jdalegonzalez/jwt_validator.py
Uses the the python-jose package to decode and validate an amazon identity or access token.
#!/usr/bin/env python3
""" Handles validation of a JWT web-token passed by the client
"""
import os
import sys
import argparse
import requests
import simplejson as json
@koorukuroo
koorukuroo / nginx_port_forwarding.ini
Created June 4, 2018 09:21
Nginx for port forwarding with 80 port
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://example.com:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
import random
import numpy as np
import caffe
# https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient
# NVIDIA nlabs
class Dice(caffe.Layer):
"""
@koorukuroo
koorukuroo / es_analyzer.py
Created February 19, 2018 06:50
ES Analyzer
import json
import requests
url = "http://0.0.0.0:9200/INDEX_NAME/_analyze"
data = {
"analyzer": "korean",
"text": "안녕하세요 반가워요 밥을 먹어요"
}
headers = {'Content-Type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data))
text = json.loads(r.text)['tokens']
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@koorukuroo
koorukuroo / basic_w2v.ipynb
Created October 20, 2017 14:33
Basic Word2Vec Sample Code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@koorukuroo
koorukuroo / fit_transform.ipynb
Last active September 22, 2017 01:39
sklearn CountVectorizer fit_transform TEST
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import boto3
from botocore.vendored import requests
import json
print('Loading function')
dynamo = boto3.client('dynamodb')
def respond(err, res=None):