Skip to content

Instantly share code, notes, and snippets.

View dmgottlieb's full-sized avatar

Dave Gottlieb dmgottlieb

View GitHub Profile
@dmgottlieb
dmgottlieb / link_filter.lua
Created May 1, 2023 20:18
pandoc lua filter to convert inline wikilinks to html links. Allows me to build the static site for my notes using a fast pandoc pipeline.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@dmgottlieb
dmgottlieb / cocitation-100.json
Created July 6, 2016 21:02
Co-cross-reference network visualization, Stanford Encyclopedia of Philosophy, top ~100 articles, Louvain community colors
{"nodes": [{"group": 2, "name": "alexander-aphrodisias"}, {"group": 2, "name": "aquinas"}, {"group": 2, "name": "aristotle"}, {"group": 2, "name": "augustine"}, {"group": 0, "name": "berkeley"}, {"group": 2, "name": "boethius"}, {"group": 5, "name": "brouwer"}, {"group": 2, "name": "buridan"}, {"group": 3, "name": "cognitive-science"}, {"group": 7, "name": "communitarianism"}, {"group": 3, "name": "compatibilism"}, {"group": 3, "name": "consciousness-intentionality"}, {"group": 3, "name": "consciousness-representational"}, {"group": 3, "name": "consciousness"}, {"group": 7, "name": "consequentialism"}, {"group": 3, "name": "content-causal"}, {"group": 3, "name": "content-externalism"}, {"group": 3, "name": "content-narrow"}, {"group": 7, "name": "democracy"}, {"group": 0, "name": "descartes"}, {"group": 5, "name": "descriptions"}, {"group": 3, "name": "determinism-causal"}, {"group": 3, "name": "dualism"}, {"group": 2, "name": "duns-scotus"}, {"group": 7, "name": "egalitarianism"}, {"group": 1, "name": "epist
@dmgottlieb
dmgottlieb / cocitation.json
Last active July 6, 2016 22:18
Co-cross-reference network visualization, Stanford Encyclopedia of Philosophy, top ~500 articles, Louvain community colors
{"nodes": [{"group": 1, "name": "abduction"}, {"group": 2, "name": "abelard"}, {"group": 5, "name": "abstract-objects"}, {"group": 3, "name": "action"}, {"group": 5, "name": "actualism"}, {"group": 1, "name": "adaptationism"}, {"group": 0, "name": "adorno"}, {"group": 0, "name": "aesthetics-18th-german"}, {"group": 7, "name": "affirmative-action"}, {"group": 2, "name": "al-kindi"}, {"group": 2, "name": "albert-great"}, {"group": 2, "name": "alexander-aphrodisias"}, {"group": 2, "name": "alyngton"}, {"group": 2, "name": "analogy-medieval"}, {"group": 5, "name": "analysis"}, {"group": 5, "name": "analytic-synthetic"}, {"group": 2, "name": "ancient-soul"}, {"group": 2, "name": "anselm"}, {"group": 5, "name": "apriori"}, {"group": 2, "name": "aquinas"}, {"group": 2, "name": "arabic-islamic-greek"}, {"group": 2, "name": "arabic-islamic-natural"}, {"group": 2, "name": "aristotle-commentators"}, {"group": 5, "name": "aristotle-logic"}, {"group": 5, "name": "aristotle-metaphysics"}, {"group": 5, "name": "aristotle-no
# SEPScraper.py
# Dave Gottlieb
#
# Scrapes article text from 2016 Spring stable edition of SEP.
from lxml import html
import requests
import re
URLstem = "http://plato.stanford.edu/archives/spr2016/"
# theano_pong_rnn.py
# Dave Gottlieb ([email protected]) 2016
#
# Pong RNN model reimplemented more correctly + flexibly directly in Theano
from theano import *
import theano.tensor as T
import numpy as np
class PongRNNModel(object):
@dmgottlieb
dmgottlieb / theano_cnn.py
Created March 2, 2016 00:27
A simple convolutional net implemented in Theano
from theano import *
import theano.tensor as T
Q = T.tensor4('Q')
W_CONV1 = shared(np.random.randn(8,1,3,3) * (1.0/6),name='W_CONV1')
b_CONV1 = shared(np.zeros(8),name='b_CONV1')
W_CONV2 = shared(np.random.randn(16,8,3,3) * 0.04,name='W_CONV2')
b_CONV2 = shared(np.zeros(16),name='b_CONV2')
W_FC = shared(np.random.randn(16*32*32,1) * .008,name='W_FC')
b_FC = shared(np.zeros(1),name='b_FC')
@dmgottlieb
dmgottlieb / numpy_pong.py
Last active February 17, 2016 02:18
Quick numpy implementation of pong, intended for applications that need to play pong programmatically. (My application is building an artificial neural network that can imitate the game engine, but you could use it for playing around with game AI.) It supports a variety of output formats, see the last part of the file.
# numpy_pong.py
# Dave Gottlieb 2016 ([email protected])
# =====
#
# small numpy implementation of Pong for programmatic interaction
#
# matplotlib is used for live visualization (in __main__)
#
# game can be started with a seed to get deterministic outcomes
@dmgottlieb
dmgottlieb / post-commit.love-distribution
Last active August 29, 2015 14:27
git post-commit hook to automatically package a love-2d project for distribution as OSX app.
#!/bin/sh
branch=$(git rev-parse --abbrev-ref HEAD $1)
date=""`date +%d`" "`date +%B`", "`date +%Y`
githash="git rev-parse --short HEAD"
echo "Build $githash of $date" > buildinfo
if [ "test" == "$branch" ]; then
@dmgottlieb
dmgottlieb / gist:56369e01521c61dd00b6
Created July 15, 2015 18:43
4-tower Tower of Hanoi solutions using μ-recursion in Haskell
import Data.List
import Data.Ord
-- Tower of Hanoi implementation
type Peg = String
type Move = (Peg, Peg)
hanoi :: Integer -> Peg -> Peg -> Peg -> [Move]
hanoi 0 a b c = [ ]
hanoi n a b c = hanoi (n-1) a c b ++ [(a,b)] ++ hanoi (n-1) c b a