This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Noddy to dump out all your gists to Markdown | |
https://developer.github.com/v3/gists/ | |
Requires the requests library. | |
""" | |
import argparse | |
import hashlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZIPFILE=lambda_process_s3_records.zip | |
SOURCES=iso8601.py lambda_process_s3_record.py | |
all: $(ZIPFILE) | |
$(ZIPFILE): $(SOURCES) | |
rm -f $@ | |
zip $@ $^ | |
.PHONY: upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-| PICO-8's Hello.lua redone in ELMO-8 | |
-} | |
import Elmo8.Console as Console | |
type alias Model = { | |
t : Int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- Simple wrapper to WebSocketExample -} | |
module Main exposing (..) | |
import Html exposing (..) | |
import Html.App as App | |
import WebSocketExample | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /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: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import contextlib | |
import functools | |
@contextlib.contextmanager | |
def forgiveness(exceptions): | |
"""Seek forgiveness | |
""" | |
try: | |
yield |
NewerOlder