Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View posquit0's full-sized avatar
🎯
Focusing

Byungjin Park (Claud) posquit0

🎯
Focusing
View GitHub Profile
@posquit0
posquit0 / chat.py
Created October 19, 2015 10:55
Simple Chat Server with Python (Not needed Client Interface)
#!/usr/bin/env python
# encoding: utf-8
from Queue import Queue
from SocketServer import BaseRequestHandler, ThreadingTCPServer
from datetime import datetime
import threading
ThreadingTCPServer.allow_reuse_address = True
@posquit0
posquit0 / kmeans.py
Created March 19, 2017 13:39
k-menas with numpy
class KMeans(object):
"""K-Means clustring
"""
def __init__(self, k, init='forgy', max_iter=50):
self.k = k
self.init = init
self.max_iter = max_iter
def _init_centers(self):
@posquit0
posquit0 / base64.js
Last active August 21, 2017 09:47
Node.js base64
/*
* base64.js
*/
const base64 = {
encode: (plain) => {
return Buffer.from(plain || '').toString('base64');
},
decode: (encoded) => {
return Buffer.from(encoded || '', 'base64').toString('ascii');

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@posquit0
posquit0 / sendgrid-cla.json
Created October 23, 2018 08:44
CLA for SendGird Contributions
{
}
@posquit0
posquit0 / kubectl.sh
Last active April 20, 2022 08:01
Useful kubectl commands
# List nodes with role and instance type sorted by creation time
kubectl get nodes -L node.kubernetes.io/role -L node.kubernetes.io/instance-type --sort-by=.metadata.creationTimestamp
@posquit0
posquit0 / gist:93200f7ca1ad3d0c943c
Created April 1, 2015 10:23
GDB with Python 2.7 in Ubuntu
apt-get install python2.7-dev python2.7
apt-get build-dep gdb
apt-get source gdb
cd gdb-*
sed -i -E "s|python3|/usr/bin/python2.7|" debian/rules
dpkg-buildpackage -uc -us -j8
dpkg-install ../*.deb
@posquit0
posquit0 / pre-commit
Last active October 10, 2023 13:39
Git Pre Commit Hook for ESLint and Jest
#!/usr/bin/env bash
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.jsx\?$')
BIN_PATH="$(git rev-parse --show-toplevel)/node_modules/.bin"
eslint() {
ESLINT="$BIN_PATH/eslint"
# Check for eslint