Skip to content

Instantly share code, notes, and snippets.

Carl Johnson carlmjohnson

Block or report user

Report or block carlmjohnson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ham.go
package sudoku
const hammDist = [...]int{
0x000: 0,
0x002: 1,
0x004: 1,
0x006: 2,
0x008: 1,
0x00A: 2,
0x00C: 2,

Keybase proof

I hereby claim:

  • I am carlmjohnson on github.
  • I am carlmjohnson ( on keybase.
  • I have a public key whose fingerprint is 30BE 0B1F 857C 534D 948C D204 EFF3 01E7 5C6D 0414

To claim this, I am signing this object:

import random
with open('/usr/share/dict/words') as f:
words = f.readlines()
carlmjohnson /
Last active Sep 15, 2015
An adaptor to use Mustache as a templating engine in Django 1.8+
import io
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateDoesNotExist
from django.template.backends.base import BaseEngine
from django.template.backends.utils import csrf_input_lazy, csrf_token_lazy
from django.utils.html import conditional_escape
from pystache import parse, Renderer
View Stereotastic Bookmarklet.js
if (location.href.indexOf('') > -1 ) {
var re = /\/[A-Za-z0-9]{6}$/;
var m = re.exec(location.href);
if (m[0] != null) {
var wiggle_url = ''+m[0]+'.gif';
var tumblr_share_url =
+ "&caption=" + encodeURIComponent('<p><a href="'+location.href+'">Stereotastic</a></p>')
+ "&click_thru=" + encodeURIComponent(location.href)
View gist:6627945
>>> funcs = []
>>> for i in range(10):
... def f(): return i
... funcs.append(f)
>>> [func() for func in funcs]
[9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
You can’t perform that action at this time.