Skip to content

Instantly share code, notes, and snippets.

View jeremyheiler's full-sized avatar

Jeremy Heiler jeremyheiler

View GitHub Profile
@maxtruxa
maxtruxa / Antonyms.md
Last active August 3, 2025 17:13
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@kisom
kisom / gtcov
Created October 19, 2014 01:24
gtcov
#!/bin/sh
# Produce an HTML file displaying code coverage. Dependencies:
# - cloc (apt-get install cloc)
# - cover (go get code.google.com/p/go.tools/cmd/cover)
if [ -z "$1" ]; then
PKG=""
else
PKG=$1
fi
@saolsen
saolsen / number-to-binary.rkt
Created August 26, 2014 16:39
number to binary
#lang racket
(define (get-spaces-inner n spaces)
(define current-space (car spaces))
(if (> current-space n)
(cdr spaces)
(get-spaces-inner n (cons (* current-space 2) spaces))))
(define (get-spaces n)
(get-spaces-inner n '(1)))
@gfredericks
gfredericks / clojure_peg_memoization_example.clj
Last active January 15, 2016 02:38
Clojure peg memoization example
(ns clojure-peg-memoization-example
"A followup to Sean Cribbs' presentation on packrat parsers:
https://github.com/seancribbs/pwl-chicago-1/
The goal is to show that in an impure language like Clojure we can
bolt on memoization after the fact and get the same performance
advantage as the Haskell implementation without bending over
backwards -- i.e., we maintain the same algorithm structure as a
recursive descent parser.
@ctford
ctford / lenses.clj
Created July 12, 2014 20:40
A Clojure lens implementation based on focus and fmap.
(ns shades.lenses)
; We only need three fns that know the structure of a lens.
(defn lens [focus fmap] {:focus focus :fmap fmap})
(defn view [x {:keys [focus]}] (focus x))
(defn update [x {:keys [fmap]} f] (fmap f x))
; The identity lens.
(defn fapply [f x] (f x))
(def id (lens identity fapply))
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 27, 2025 16:31
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@fogus
fogus / core.clj
Last active December 20, 2015 09:09
(ns depr.core)
(defn ^:private !! [c]
(println "WARNING - Deprecation of " c " in effect."))
(defmacro defn-deprecated
[nom _ alt ds & arities]
(let [silence? (:silence-deprecations (meta clojure.core/*ns*))]
(when-not silence?
(!! alt)))
@jackrusher
jackrusher / OO.md
Created July 29, 2013 12:53
Gist blogging? Yet another exposition on the nature of OO programming.

Object-orientation

There are many articles and discussion threads on the web regarding the nature of Object-oriented (OO) programming. Most of them come at the question from a Programming Language Theory (PLT) perspective, attempting to assert a formal definition of OO programming and objects. I'm not going to do that here. Instead, I'm going to write about objects from an implementation perspective, approaching the subject first from below and then from above.

@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active June 25, 2025 15:36
5 entertaining things you can find with the GitHub Search API