Instantly share code, notes, and snippets.

View keybase.md

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:

View base64.js
/*
* base64.js
*/
const base64 = {
encode: (plain) => {
return Buffer.from(plain || '').toString('base64');
},
decode: (encoded) => {
return Buffer.from(encoded || '', 'base64').toString('ascii');
View pre-commit
#!/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
View kmeans.py
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):
View chat.py
#!/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
View gist:93200f7ca1ad3d0c943c
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