Skip to content

Instantly share code, notes, and snippets.

@WFT
WFT / b64_image_utils.py
Created January 27, 2014 05:30
base64 PIL processing
import Image
from cStringIO import StringIO
import base64
def combine_b64(top, bottom, x, y):
a = b64_to_Image(top)
b = b64_to_Image(bottom)
return Image_to_b64(combine(a, b, x, y))
def Image_to_b64(img):
@WFT
WFT / Robot.laf
Created September 16, 2014 21:05
Robot.laf
skeleton 0 0 0 {
vary j 1 360 1 90
sphere 1 1 1 0 0 0 0 0 0
bone 3 0 0 {
cube 1.5 1 1 0 0 0 1.5 0 0
sphere 1 1 1 0 0 0 3 0 0
bone 3 3 0 {
cube 1 1.5 1 0 0 0 3 1.5 0
sphere 1 1 1 0 0 0 3 3 0
bone 3 3 3 {
@WFT
WFT / vcs.lisp
Last active August 29, 2015 14:18
simple lisp vcs
;;; A simple VCS
;; Operation creation functions
(defmacro make-operation (position operation &rest rest)
`(list :operation ,operation :pos ,position ,@rest))
(defun insert (string position)
(make-operation position :insert :string string))
@WFT
WFT / waiwo.js
Last active August 29, 2015 14:23
What Am I Working On? (WAIWO)
// Super simple access to your most recently interacted with GitHub repo
function fetch(route, callback) {
// Ignoring old browsers...
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState === 4)
callback(request.responseText);
}
request.open('GET', route);
@WFT
WFT / keybase.md
Created July 14, 2016 20:42
keybase.md

Keybase proof

I hereby claim:

  • I am wft on github.
  • I am willft (https://keybase.io/willft) on keybase.
  • I have a public key ASAyqXXcLCfWQ8u15BLYAXKazFg6reqWo_BUcogRSoIDFwo

To claim this, I am signing this object:

@WFT
WFT / simopen.sh
Last active December 22, 2016 19:42
Opens a file in the iOS simulator using a file URL.
#!/bin/bash
set -e
if [[ $# -eq 1 || $# -eq 2 ]]; then
url="file://$(realpath "$1" | sed 's/ /%20/g')"
xcrun simctl openurl ${2:-booted} "$url" ||
echo "$url" could not be opened
else
echo "USAGE: $0 PATH [SIM_NAME]"
@WFT
WFT / Bar.swift
Last active January 13, 2018 00:00
pgdl test
public struct Bar {
public struct Foo: CustomStringConvertible {
public var description: String { return "Foo!" }
public init() { }
}
public static func food() -> Foo { return Foo() }
}
@WFT
WFT / osstatus.sh
Created March 31, 2021 16:40
Search osstatus.com from command line
#!/bin/bash
if [[ $# -eq 1 ]]; then
open "https://osstatus.com/search/results?search=$1"
else
echo "Usage: osstatus NUMBER"
exit 1
fi
@WFT
WFT / appstore_testing_support.py
Last active October 23, 2023 19:35
appstore_testing_support.py
from cryptography import x509
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.x509.oid import NameOID
import jwt
import cattrs
import datetime
from base64 import b64encode
from uuid import uuid4