Skip to content

Instantly share code, notes, and snippets.

View e0en's full-sized avatar

Yoonseop Kang e0en

  • SIGTERM inc.
  • Seoul, South Korea
View GitHub Profile
@e0en
e0en / base64sha384.zsh
Created October 27, 2018 09:56
Calculate base64-encoded SHA-384 hash of a file. Useful when you need to fill "integrity" field of HTML resources.
# calc base64-encoded sha384 hash of a file
base64sha384 () {
openssl dgst -sha384 -binary < $1 | openssl enc -base64
}
@e0en
e0en / sony_korea_noti_checker.py
Created May 1, 2019 07:51
A twitter bot that posts any new announcements from SONY korea online store
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from pathlib import Path
import time
import traceback
from urllib import request
from urllib.parse import urlencode
from bs4 import BeautifulSoup
@e0en
e0en / requirements.txt
Last active November 19, 2018 12:46
SONY Korea online store notification twitter bot, written in python
bs4
python-twitter
@e0en
e0en / hosts
Created September 17, 2018 09:28
block stupid websites
127.0.0.1 clien.net
127.0.0.1 namu.wiki
127.0.0.1 pgr21.com
@e0en
e0en / build_proxygen_on_macos.sh
Last active August 31, 2018 13:03
A simple bash script for build & installing facebook/proxygen on MacOS 10.14 Mojave
#!/bin/bash
set -x
# homebrew dependencies
brew install cmake pkgconfig automake openssl md5sha1sum
brew install autoconf-archive libtool wget boost libsodium folly
OPENSSL_DIR="$(brew --prefix openssl)"
@e0en
e0en / common_ssl_setting.conf
Created August 26, 2018 09:02
nginx site setting with https redirection + subdomain
ssl_certificate /etc/letsencrypt/live/foo.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/foo.com/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
# Enable server-side protection against BEAST attacks
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
@e0en
e0en / match-score.py
Created November 23, 2017 07:50
The secret algorithm for user taste score
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
alphabet_to_num = {
'A': 3,
'B': 3,
'C': 1,
'D': 2,
@e0en
e0en / no-work-posession.py
Created March 6, 2017 01:44
How much money do I need to quit working?
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def geometric_coeff(percentage, n):
if percentage != 0:
ratio = percentage / 100.0
return float((1 + ratio) ** n - 1) / ratio
else:
return n
@e0en
e0en / gist:b834bfac2b3c7ee8ab46
Created December 26, 2014 03:56
Convert a `Future[Seq]` into a `Future[Map]`
import com.twitter.util.Future
var seq = Future(Seq(1,2,3))
seq map { s => Map(s map {x => x -> x * 2}): _*) }