Skip to content

Instantly share code, notes, and snippets.

@micktwomey
micktwomey / game.txt
Created September 19, 2026 13:11
flickgame
{"gameLink":"www.flickgame.org","activeIndex":0,"canvasses":[[3580,"0",14,"b",144,"0",18,"b",140,"0",22,"b",136,"0",26,"b",132,"0",29,"b",130,"0",11,"b",10,"0",10,"b",128,"0",10,"b",14,"0",9,"b",126,"0",9,"b",18,"0",7,"b",125,"0",8,"b",22,"0",6,"b",123,"0",7,"b",24,"0",6,"b",122,"0",7,"b",26,"0",6,"b",121,"0",6,"b",27,"0",6,"b",120,"0",6,"b",29,"0",6,"b",119,"0",6,"b",29,"0",6,"b",119,"0",5,"b",31,"0",5,"b",118,"0",6,"b",31,"0",6,"b",117,"0",6,"b",31,"0",6,"b",116,"0",6,"b",33,"0",5,"b",116,"0",6,"b",33,"0",5,"b",116,"0",5,"b",34,"0",5,"b",115,"0",6,"b",34,"0",5,"b",115,"0",6,"b",34,"0",5,"b",115,"0",5,"b",36,"0",3,"b",116,"0",5,"b",155,"0",5,"b",155,"0",5,"b",72,"0",4,"b",79,"0",5,"b",71,"0",6,"b",78,"0",5,"b",71,"0",6,"b",78,"0",6,"b",70,"0",7,"b",77,"0",6,"b",71,"0",7,"b",77,"0",5,"b",72,"0",6,"b",77,"0",5,"b",73,"0",5,"b",77,"0",6,"b",72,"0",5,"b",77,"0",6,"b",72,"0",5,"b",78,"0",6,"b",71,"0",5,"b",78,"0",7,"b",70,"0",5,"b",79,"0",6,"b",70,"0",5,"b",80,"0",7,"b",67,"0",6,"b",80,"0",8,"b",66,"0",6,"b",81,"
@micktwomey
micktwomey / export_gists_to_markdown.py
Last active March 10, 2024 20:55
Python script to export your gists (public or private) to a single Markdown file. This is useful for backing up or exporting. Doesn't preserve full revision history.
"""Noddy to dump out all your gists to Markdown
https://developer.github.com/v3/gists/
Requires the requests library.
"""
import argparse
import hashlib
@micktwomey
micktwomey / client.py
Created October 1, 2010 13:03
python multiprocessing socket server example
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()
@micktwomey
micktwomey / mttpstats.py
Created October 2, 2010 14:32
redis profiling
"""Class for printing reports on profiled python code."""
# Modified by mtt to support loading of stats without creating file objects
# Class for printing reports on profiled python code. rev 1.0 4/1/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# see profile.doc and profile.py for more info.
@micktwomey
micktwomey / Makefile
Last active June 25, 2018 17:32
Overcomplicated Raspberry Pi + Sense Hat + Firehose + Lambda + Hosted Graphite Thermometer
ZIPFILE=lambda_process_s3_records.zip
SOURCES=iso8601.py lambda_process_s3_record.py
all: $(ZIPFILE)
$(ZIPFILE): $(SOURCES)
rm -f $@
zip $@ $^
.PHONY: upload
@micktwomey
micktwomey / HelloWorld.elm
Created October 20, 2016 22:45
ELMO-8 HelloWorld.elm
{-| PICO-8's Hello.lua redone in ELMO-8
-}
import Elmo8.Console as Console
type alias Model = {
t : Int
}
@micktwomey
micktwomey / Hello.elm
Last active October 19, 2016 23:23
ELMO-8 Hello World.
import Elmo8.Console as Console
import Elmo8.Palettes.Pico8 as Palette
type alias Model = {}
draw : Console.Console Model -> Model -> List Console.Command
draw console model =
[ Console.sprite 2 60 30
]
@micktwomey
micktwomey / Main.elm
Last active May 17, 2016 10:04
Reproduces TypeError seen in Elm 0.17
{- Simple wrapper to WebSocketExample -}
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import WebSocketExample
@micktwomey
micktwomey / redis.conf.diff
Created October 25, 2012 15:46
Difference between default redis 2.4 and 2.6 configs
--- /dev/fd/63 2012-10-25 16:46:38.000000000 +0100
+++ /dev/fd/62 2012-10-25 16:46:38.000000000 +0100
@@ -1,6 +1,6 @@
# Redis configuration file example
-# Note on units: when memory size is needed, it is possible to specifiy
+# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
@micktwomey
micktwomey / utf8bmp.py
Created October 16, 2012 11:01
WSGI middleware to replace non-BMP characters in JSON with unknown character. Works around poor UTF-8 support in certain dbs.
"""WSGI middleware and test code to munge utf-8
To work around narrow builds you need to do this:
re.sub(r'\\U[0-9a-f]{8}', '\\ufffd', s.encode("unicode_escape")).decode("unicode_escape")
(Use the representation)
"""