Skip to content

Instantly share code, notes, and snippets.

Avatar
🚴‍♂️
Making my way downtown

Brian Muhia poppingtonic

🚴‍♂️
Making my way downtown
View GitHub Profile
@cgrand
cgrand / maze.clj
Created Jan 24, 2011
A maze generator (Wilson's algorithm) which can work with any topography (hextiles, torus variants, teapot etc.)
View maze.clj
; http://groups.google.com/group/clojure/browse_thread/thread/974e2c7f89e27231/5f4bff3e58dfa36f
; output images http://i.imgur.com/gSASS.png (square maze)
; http://i.imgur.com/uEqaq.png (hex maze)
;; generic Wilson's algorithm implementation
(defn maze
"Returns a random maze carved out of walls; walls is a set of
2-item sets #{a b} where a and b are locations.
The returned maze is a set of the remaining walls."
[walls]
@lmullen
lmullen / gist:3767386
Created Sep 22, 2012
Make all markdown files in directory into PDFs
View gist:3767386
# Produce PDFs from all Markdown files in a directory
# Lincoln Mullen | http://lincolnmullen.com | lincoln@lincolnmullen.com
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst %.md,%.md.pdf,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
@zmaril
zmaril / core.clj
Last active Dec 16, 2015
Simple rejection sampling based probabilistic programming library. An approximation of church.
View core.clj
(ns hacklheber.core)
(defn flip
"A function which returns true or false randomly. Can optionally be
supplied a number for a bias."
([] (> 0.5 (rand)))
([p] (> p (rand))))
(defn- memo-bangs
"If a variable is bound with a bang, then it will be memoized."
@mremond
mremond / README
Last active May 4, 2020
Phoenix Elixir framework with ejabberd - Tutorial
View README
Please read original blog post for reference:
http://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/
View TitleCase.pl
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber:
@oguya
oguya / fah-config.xml
Created Sep 30, 2015
FAHClient config. file—/etc/fahclient/config.xml
View fah-config.xml
<config>
<!-- See sample config: /usr/share/doc/fahclient/sample-config.xml -->
<!-- Client Control
Don't fold anonymously, provide user info. -->
<fold-anon v='false'/>
<!-- Folding Slot Configuration -->
<gpu v='true'/> <!-- If true, attempt to autoconfigure GPUs -->
@jsheedy
jsheedy / iter_file.py
Last active Apr 9, 2021
Sometimes you need a file-like object when all you have is an iterator, for instance when using psycopg2's cursor.copy_from. This class will handle the impedance mismatch.
View iter_file.py
import io
import sys
class IteratorFile(io.TextIOBase):
""" given an iterator which yields strings,
return a file like object for reading those strings """
def __init__(self, it):
self._it = it
self._f = io.StringIO()
View types.markdown

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

View age-of-em-review.markdown

Every piece of speculation about the future I've ever encountered broadly pattern-matches into one of four genres: forecasting, prophecy, literary works of fiction, and rants. Age of Em doesn't autocomplete into any of these, and I think both my irritation and fascination with it come from the same source -- the audacity of creating an entirely new genre of futurism.

Here are rough properties of the existing four genres:

  • Forescasting - narrow subject matter, falsifiable details that
@ashwinrayaprolu
ashwinrayaprolu / Install.md
Created Apr 20, 2019
OpenVINO Ubuntu Xenial, Virtualbox and Vagrant Install, Intel NCS2 (Neural Compute Stick 2)
View Install.md