Skip to content

Instantly share code, notes, and snippets.

View hohyon-ryu's full-sized avatar

Will Hohyon Ryu hohyon-ryu

View GitHub Profile
@hohyon-ryu
hohyon-ryu / malbit_cards.html
Created April 10, 2026 01:58
말빛 사전 카드 30개 — 더나일 말빛 프로젝트
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>말빛 사전 카드 30개 — 더나일</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; background: #fdf8f3; color: #333; padding: 24px 16px; }
h1 { text-align: center; font-size: 28px; color: #2d6a4f; margin-bottom: 8px; }
@hohyon-ryu
hohyon-ryu / chunk_message.py
Created January 12, 2016 07:28
Chunk a long message into chunks of max length n with the page numbers like (1/10)
def chunk(msg, n):
words = msg.split(" ")
totalPages = 1
prevTotalPages = 0
while totalPages != prevTotalPages:
chunks = []
chunk = []
for word in words:
page = "(%d/%d)" % (len(chunks) + 1, totalPages)
if len(" ".join(chunk + [page])) > n:
@hohyon-ryu
hohyon-ryu / lda_gibbs.py
Created September 11, 2011 01:35 — forked from mblondel/lda_gibbs.py
Latent Dirichlet Allocation with Gibbs sampler
"""
(C) Mathieu Blondel - 2010
Implementation of the collapsed Gibbs sampler for
Latent Dirichlet Allocation, as described in
Finding scientifc topics (Griffiths and Steyvers)
"""
import numpy as np
@hohyon-ryu
hohyon-ryu / gist:1107915
Created July 26, 2011 20:21
Get a 3D plane through 3 points and get z of a point (x,y) on that plane
require "matrix"
def cross( v, w )
x = v[1]*w[2] - v[2]*w[1]
y = v[2]*w[0] - v[0]*w[2]
z = v[0]*w[1] - v[1]*w[0]
Vector[x,y,z]
end
def multi_sumV( v, w )
@hohyon-ryu
hohyon-ryu / ES_Stemming.rb
Created May 25, 2011 19:19
Stemming for ElasticSearch
# Script to test stemming for ElasticSearch. Working now!!
# Reference: http://stackoverflow.com/questions/4981001/why-elasticsearch-is-not-finding-my-term
require 'rubygems'
require 'net/http'
require 'yaml'
require 'json'
# kill the index
delete = Net::HTTP::Delete.new("/willindex")