Skip to content

Instantly share code, notes, and snippets.

View eigenfoo's full-sized avatar
Probably drinking coffee

George Ho eigenfoo

Probably drinking coffee
View GitHub Profile
@eigenfoo
eigenfoo / asdf.sh
Last active September 13, 2017 02:51
shell script for some command line fun
#!/bin/bash
# Dependencies: fortune, cowsay, lolcat and coreutils
# brew install fortune cowsay lolcat coreutils
# Directory where the ASCII art is
cowfiledir='/usr/local/Cellar/cowsay/3.04/share/cows/'
randfile=$(ls $cowfiledir/*.cow | gshuf -n 1)
basefile=$(basename $randfile)
cowarg=${basefile%.*}
@eigenfoo
eigenfoo / Makefile
Last active November 9, 2017 03:01
C++ simple general-purpose Makefile
.PHONY: clean debug run
CXX = g++
CXXFLAGS = -std=c++11 -Wall -Wextra
LDFLAGS =
SOURCES = hash.cpp spellcheck.cpp
OBJECTS = $(SOURCES:.cpp=.o)
EXECUTABLE = spell.exe
Cluster #14:
Cluster importance: 0.0489376285127
shit: 2.433590
test: 1.069885
frame: 0.396684
pass: 0.204953
bitch: 0.163619
@eigenfoo
eigenfoo / finite_support_bandit.py
Last active August 31, 2018 14:42
Solving finitely-supported multi-armed bandit with Thompson sampling
def make_bandits(params):
def pull(arm, size=None):
while True:
# Logit-normal distributed returns (or any distribution with finite support)
# `expit` is the inverse of `logit`
reward = expit(np.random.normal(loc=params[arm], scale=1, size=size))
yield reward
return pull, len(params)
#!bin/python
import numpy as np
batch_size = 32
image_height = 256
image_width = 256
num_channels = 3
# You can think of multi-dimensional arrays (a.k.a. ndarrays or tensors) as
@eigenfoo
eigenfoo / einsum_demo.py
Created February 3, 2019 23:36
Example of how Einstein notation simplifies tensor manipulations.
#!/bin/python
from time import time
import torch
batch_size = 128
image_width = 64
image_height = 64
num_channels = 3 # RGB, for instance.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@eigenfoo
eigenfoo / NeutralPolitics.csv
Created April 18, 2019 01:47
Dump of r/NeutralPolitics comments.
We can't make this file beautiful and searchable because it's too large.
text
" what points to no collusion which of these claims or others support the notion that it’s all on the up and up those are two separate things just because something doesnt support one conclusion doesnt mean it automatically support the other trump alienating members of the g7 while insisting that russia should be part of the group falls under trump says nice things about russia and trump called for not insisted and its clear thats not happening regardless of what trump says while supportive it in no way is evidence towards collusion its just dumb policy from trump being unwilling to follow through on the sanctions imposed on russia by an entirely separate branch of government for meddling in our elections trump did follow through sanctions are in place he followed the law as it was written reversing sanctions on i dont see anywhere that trump has reversed any sanctions snopes says that idea is mostly false never mind i don’t want to have to link to all the news reports that this group demands there would
@eigenfoo
eigenfoo / blog.png
Last active June 17, 2019 23:50
Personal website and blog
blog.png
@eigenfoo
eigenfoo / setup.py
Created September 9, 2019 00:58
Template setup.py file
""" Template setup.py file """
from os.path import dirname, realpath, join, exists
from re import search, M
from setuptools import setup, find_packages
# TODO: add package details
NAME = ""
MAINTAINER = ""