Skip to content

Instantly share code, notes, and snippets.

View irskep's full-sized avatar
💭
~emo song lyrics~

Steve Landey irskep

💭
~emo song lyrics~
View GitHub Profile
def postorder_traversal(self, node=None):
"""Yields every node in the tree in post-order"""
root = node or self.root
stack = deque([(root, 'yield'), (root, 'children')])
while len(stack) > 0:
(node, action) = stack.pop()
if action == 'yield':
yield node
elif action == 'children':
for i in reversed(range(len(node.children))):

Keybase proof

I hereby claim:

  • I am irskep on github.
  • I am stevejohnson (https://keybase.io/stevejohnson) on keybase.
  • I have a public key whose fingerprint is 982C DBCA 98E6 AC5C 1F93 DEB2 8DB1 2375 2CFC E86C

To claim this, I am signing this object:

#!/bin/bash
SCREEN_COUNT=0
echo Capture started on `date`
echo Capture started on `date` >> log.txt
trap ctrl_c INT
function ctrl_c() {
echo Capture ended on `date` with $SCREEN_COUNT screens captured.
echo Capture ended on `date` with $SCREEN_COUNT screens captured. >> log.txt
exit
}
//
// REXPaintImage.swift
//
// Created by Steve Johnson on 1/7/18.
//
// Copyright (c) 2018, Steve Johnson
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// REXPaintImage+BearLibTerminal.swift
//
// Copyright (c) 2018, Steve Johnson
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//
// RecursiveShadowcastingFOVProvider.swift
//
// Copyright (c) 2018, Steve Johnson
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
Sans Serif
Serif
Monospace
Other
italic
bold
Color to change:
stroke
fill
@irskep
irskep / PCG32.swift
Last active February 25, 2018 20:02
PCG-32 implementation in Swift 4
/*
MIT License
Copyright (c) 2017 Steve Johnson <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
// do some stuff...
func test() {
DispatchQueue.main.async {
print(Thread.isMainThread)
exit(0)
}
}
test()
@irskep
irskep / literallycanvas demo.js
Created June 14, 2018 02:20
Basic requirements to get literallycanvas working
// package.json
{
"name": "frontend",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"create-react-class": "^15.6.3",
"literallycanvas": "^0.5.2",