Skip to content

Instantly share code, notes, and snippets.

View ssut's full-sized avatar

Suhun Han ssut

View GitHub Profile
@ssut
ssut / raggedness.py
Last active August 29, 2015 14:04
very weird raggedness word-wrap implementation written in Python
# -*- coding: utf-8 -*-
from sys import argv, exit
cac = []
res = []
words = []
M = 0
for x in range(1000):
cac.append([-1 for j in range(1000)])
@ssut
ssut / Code.gs
Last active August 29, 2015 14:06
get exchange rate from wooribank
function getDate(decrease) {
var date = new Date();
if(decrease && decrease > 0) {
date = new Date(date);
date.setDate(date.getDate() - decrease);
}
var yyyy = date.getFullYear().toString(),
dd = date.getDate().toString(),
mm = (date.getMonth() + 1).toString();
#!/bin/bash
NAME=$1
FROM=$2
PIDFILE=".$1.pid"
DIR=$(pwd)
PERIOD=${3:-7}
PRIORITY=${4:-10}
FILENAME="$(date +%Y-%m-%d_%H%M).tar.gz"
BACKUPDIR="$DIR/backups/$NAME"
@ssut
ssut / clien.css
Created December 16, 2015 17:13
clien transformer
/* layout
-------------------------------------*/
body {
margin: 0 3.5%;
padding: 0;
font-family: 'NanumGothic';
}
p, h2, tr, td, td a, select {
font-family: 'NanumGothic'!important;
@ssut
ssut / main.py
Created February 9, 2016 07:06
Simplest way to sort Japanese in python
import icu
import romkan
from unihandecode import Unihandecoder
def main():
d = Unihandecoder(lang='ja')
collator = icu.Collator.createInstance(icu.Locale('ja_JP.UTF-8'))
table = [
u"女言葉の消失", # 2
@ssut
ssut / payapp.py
Created May 17, 2016 12:53
A Simple PayApp Implementation
# coding: utf-8
try:
import requests
except ImportError:
raise ImportError(u'requests 패키지가 설치되어있지 않습니다.\n>> pip install requests')
from urllib.parse import parse_qsl
from collections import namedtuple
from datetime import datetime
import json
@ssut
ssut / packages.md
Last active November 27, 2016 10:37
memo
@ssut
ssut / dns-over-https.go
Created February 16, 2017 13:48
dnsoverhttps
package main
import (
"encoding/json"
"errors"
"net/url"
fasthttp "github.com/valyala/fasthttp"
)
import * as amqp from 'amqplib';
export class ExponentialBackoffHelper {
private maxDelay: number = 60;
private factor: number = 2;
private maxAttempts: number = 5;
constructor(
@ssut
ssut / Currencies.md
Last active May 25, 2021 08:28 — forked from aaronhayes/Currencies.md
Common Currencies Array JSON