Skip to content

Instantly share code, notes, and snippets.

View chongkong's full-sized avatar
🎯
Focusing

Jongbin Park chongkong

🎯
Focusing
View GitHub Profile
@chongkong
chongkong / SimpleTable.js
Last active May 13, 2016 00:15
Simple Table with ECMA2015, dependency on Bootstrap 4.0 and font-awesome
tableData = {
data: [],
totalCount: 1000,
loadMore() {
if (this.data.length < this.totalCount) {
this.data = this.data.concat([
{
id: this.data.length + 1,
name: Math.random().toString(36).substring(2, 7),
age: Math.ceil(30 * Math.random())
@chongkong
chongkong / aes_cipher.py
Last active May 18, 2016 08:50
AES Encrypt/Decrypter using PyCrypto
import random
import string
from base64 import b64decode, b64encode
from Crypto.Cipher import AES
BLOCK_SIZE = 128 // 8
def pkcs7_pad(s):
pad_len = BLOCK_SIZE - (len(s) % BLOCK_SIZE)
return s + (pad_len * chr(pad_len))
<!doctype html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<section>
<div class="container">
<h1>CSV Table Example</h1>
<label>CSV File</label>
<input id="file-input" type="file" onchange="">
@chongkong
chongkong / sample.py
Last active August 29, 2016 04:53
get() query does not load joinedloaded relationship when reloading expired object
from sqlalchemy import Column, BigInteger, ForeignKey, create_engine
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
Session = sessionmaker()
class Foo(Base):
__tablename__ = 'foo'
@chongkong
chongkong / keybase.md
Created January 24, 2017 02:36
Keybase

Keybase proof

I hereby claim:

  • I am chongkong on github.
  • I am chongkong (https://keybase.io/chongkong) on keybase.
  • I have a public key whose fingerprint is 6535 990E EC0B 18B5 BEF0 8CE8 E74E 2834 0EE3 75BB

To claim this, I am signing this object:

@chongkong
chongkong / animation.html
Last active January 29, 2017 19:24
Efficient data structure for storing quad-partial data
<!doctype html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.4.1/snap.svg-min.js"></script>
</head>
<body>
<script>
const GREEN = "#77cc22";
const BLUE = "#2277ee";
const LIGHTGRAY = "#dddddd";
const DARKGRAY = "#cccccc";
@chongkong
chongkong / 1.md
Last active February 16, 2017 09:55
TimeAndDate Feedback

South Korean Holidays Feedback

Hello timeanddate. I've recently looked through the holidays of South Korea in timeanddate and found out some of them are wrong, have weird translation, or some holidays are missing. (link) As a native Korean, I'd like to give you some thorough feedback on it.

1. Typo in New Year's Day.

There's no closing parenthesis in new-year-day's Korean Translation.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chongkong
chongkong / number_baseball.py
Created October 28, 2017 09:02
간단한 숫자야구 구현
import itertools
import random
class NumberBaseball(object):
RANGE = range(10)
PITCHES = 4
def __init__(self, ans):
assert len(ans) == len(set(ans))
@chongkong
chongkong / thorq.py
Last active December 16, 2017 13:53
ThorQ utility
""" MIT License
Copyright (c) 2017 chongkong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: