Skip to content

Instantly share code, notes, and snippets.

View WKBae's full-sized avatar

Kyungmin Bae WKBae

  • Devsisters Corp.
  • Seoul, South Korea
View GitHub Profile
@WKBae
WKBae / joiner.py
Created July 17, 2017 02:00
.srt Subtitle Joiner
import re
duration_re = re.compile(r"^\d{2}:\d{2}:\d{2},\d{3} --> \d{2}:\d{2}:\d{2},\d{3}\n$")
with open('input1.srt', 'r', encoding='utf-8') as one, open('input2.srt', 'r', encoding='utf-8') as two, open('result.srt', 'w', encoding='utf-8') as out:
one_lines = []
line = one.readline()
while line:
while len(line) == 1:
line = one.readline()
@WKBae
WKBae / zip-password-finder.py
Last active September 21, 2017 08:54
Quick brute-force password finder of an encrypted zip file.
"""
Quick brute-force password finder of an encrypted zip file.
"Life's short, use Python."
by WKBae (https://github.com/WKBae/)
"""
import zipfile
from multiprocessing import Pool
@WKBae
WKBae / mnist-tester.html
Last active November 9, 2017 13:19
MNIST tester using Flask
<html>
<head><title>MNIST Tester</title></head>
<style>
#number-pad {
padding: 0;
margin: 0;
border-collapse: collapse;
border: 1px solid #000;
}
#number-pad tr {

Keybase proof

I hereby claim:

  • I am wkbae on github.
  • I am wkbae (https://keybase.io/wkbae) on keybase.
  • I have a public key ASCqx7Fvx6LeDfoLSjG5UrFMXKLcaANzfm9032L2viJslgo

To claim this, I am signing this object:

@WKBae
WKBae / unlimited_buffered_chanel.go
Created March 29, 2020 12:37
Unlimited buffered channel in Go
package main
import (
"fmt"
"sync"
"time"
)
func unlimitedBufferer(in <-chan int, out chan<- int) {
var buffer []int
🌞 Morning 272 commits ████▏░░░░░░░░░░░░░░░░ 20.2%
🌆 Daytime 666 commits ██████████▍░░░░░░░░░░ 49.5%
🌃 Evening 399 commits ██████▏░░░░░░░░░░░░░░ 29.6%
🌙 Night 9 commits ▏░░░░░░░░░░░░░░░░░░░░ 0.7%
@WKBae
WKBae / semaphore.js
Created July 19, 2024 12:31
JS Async Semaphore / Limit Concurrency
function semaphore(n) {
let running = 0;
const queue = [];
return (fn) => {
return new Promise((resolve) => {
const task = () => {
running++;
resolve(
fn().finally(() => {
running--;