Skip to content

Instantly share code, notes, and snippets.

View bukzor's full-sized avatar
🌥️
learning google cloud

Buck Evan bukzor

🌥️
learning google cloud
  • google.com
  • Appleton, WI
  • 00:06 (UTC -06:00)
View GitHub Profile
@bukzor
bukzor / .gitignore
Last active August 29, 2015 14:06
find_requirements diagram
*/
@bukzor
bukzor / slow-pip.png
Last active August 29, 2015 14:06
pip-wheel profile
NT
DISTRO:
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
KERNEL:
Linux xubuntu-try4 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
DMIDECODE:
@bukzor
bukzor / gist:8746934
Last active May 30, 2019 00:44
Sierpinski Gasket, in sed
CMD='h;s/(.)/\1\1\1/g;x;s/(.)/\1 \1/g;H;s/(.) (.)/\1\1\2/g;H;x' sh -c 'echo "|" | sed -r "$CMD" | sed -r "$CMD" | sed -r "$CMD" | sed -r "$CMD"'
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || || || || || || || || || || || || || || || || || || || || || || || || || || |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||
| | | || | | || | | || | | || | | || | | || | | || | | || | | |
||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || || || || || || || || || || || || || || || || || || || || || || || || || || |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@bukzor
bukzor / gist:8738932
Last active February 22, 2022 18:49
Sierpinksi Triangle, in sed
# Sierpinksi Triangle, in sed:
$ f() { sed -r 'h;s/(.)/\1\1/g;x;s/(.)/\1 /g;H;x'; }
$ echo o|f
oo
o
$ echo o|f|f
oooo
# Cantor's dust, in sed
$ CMD='h;H;H;x;s/\n//g;h;s/./ /g;H;x;h;H;x;s/\n *$//' sh -c 'echo o | sed "$CMD"'
ooo
ooo
$ CMD='h;H;H;x;s/\n//g;h;s/./ /g;H;x;h;H;x;s/\n *$//' sh -c 'echo o | sed "$CMD" | sed "$CMD"'
ooooooooo
ooooooooo
@bukzor
bukzor / gist:5177848
Created March 16, 2013 19:12
Some code which will pinpoint differences in nested structures. Possibly useful for `testfixtutres.compare()`.
class TestAssertEqualDeep(T.TestCase):
def test_numbers(self):
assert_equal_deep(1, 1)
with assert_raises_with_args(AssertionError, '\nUnequal at / : 1 != 2'):
assert_equal_deep(1, 2)
def test_strings(self):
assert_equal_deep('foo', 'foo')
with assert_raises_with_args(AssertionError, "\nUnequal at / : 'foo' != 'bar'"):
assert_equal_deep('foo', 'bar')
@bukzor
bukzor / test3.py
Last active December 10, 2015 22:48
Try to assert that the pudb ctrl+p interaction works as intended.
#!/usr/bin/env python
"pudb test script"
def main():
"The entry point"
from pudb.debugger import Debugger
import urwid.html_fragment
dbg = Debugger()
@bukzor
bukzor / test2.py
Created January 10, 2013 17:30
Demonstrate the skeleton of a testing strategy for pudb.
#!/usr/bin/env python
"pudb test script"
from pudb.debugger import Debugger
def dedent(text):
"dedent and strip"
from textwrap import dedent as _dedent
return _dedent(text).strip('\n')
D = dedent
@bukzor
bukzor / HelloWorld.as
Created December 28, 2012 00:35
Demo: TextField.text behaves differently when a stylesheet is set, even if the stylesheet is empty. The desired behavior is to get styled plain text (i.e. literal <i> tags displayed in output).
package {
import flash.text.TextField;
import flash.text.StyleSheet;
import flash.display.Sprite;
import flash.system.Capabilities;
public class HelloWorld extends Sprite {
private var textField:TextField;