Skip to content

Instantly share code, notes, and snippets.

🐦
bird

Amber Brown hawkowl

🐦
bird
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am hawkowl on github.
  • I am hawkowl (https://keybase.io/hawkowl) on keybase.
  • I have a public key ASB7kALTIBq2kBRUsMl1kXyRc3IGwDWkqBAsr9HtVCciNAo

To claim this, I am signing this object:

@hawkowl
hawkowl / glitchulate.py
Created Aug 26, 2016
Make your favourite images into glitched monstrosities! (Requires pillow from PyPI, Py2/3/pypy compatible)
View glitchulate.py
from __future__ import print_function
import sys
import random
from collections import deque
from PIL import Image
# THIS IS THE MAGIC VALUE THAT MAKES EVERYTHING GLITCHED
View gist:62b38702073f6f9de7933d392712a605
red ~/test [127]> python3 -m virtualenv --clear test
Not deleting test/bin
Using base prefix '/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5'
New python executable in test/bin/python3.5
Also creating executable in test/bin/python
Installing setuptools, pip, wheel...done.
red ~/test> python -m virtualenv --clear test
Not deleting /Users/red/test/test/bin
Using real prefix '/System/Library/Frameworks/Python.framework/Versions/2.7'
New python executable in /Users/red/test/test/bin/python
View gist:5004980
red ~/code/bootstrap/ (master) $
npm install phantomjs
npm http GET https://registry.npmjs.org/phantomjs
npm http 200 https://registry.npmjs.org/phantomjs
npm http GET https://registry.npmjs.org/phantomjs/-/phantomjs-1.8.1-3.tgz
npm http 200 https://registry.npmjs.org/phantomjs/-/phantomjs-1.8.1-3.tgz
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/unzip
npm http 200 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/rimraf/-/rimraf-2.0.3.tgz
View gist:d1c7e13997fa6553efc4
import platform
p = platform.linux_distribution()
if p[0] == "debian" and float(p[1]) > 7:
print "New Debian"
else:
print "Old Debian"
View gist:c5c37c2b0318edcccb6c
from twisted.python.compat import networkFormat, networkString, nativeString
import timeit
# Mixed types
def mixed_format():
networkFormat("{0}:{1}:{2}", (b"foo", u"bar", "baz"))
def bytes_format():
networkFormat("{0}:{1}:{2}", (b"foo", b"bar", b"baz"))
View gist:37cb658649801309e00b
from twisted.python.compat import networkFormat, networkString, nativeString
import timeit
# Mixed types
def mixed_format():
networkFormat("{0}:{1}:{2}", (b"foo", u"bar", "baz"))
def bytes_format():
networkFormat("{0}:{1}:{2}", (b"foo", b"bar", b"baz"))
View gist:5a9c4e74638b05b3a1d9
(require 'multiple-cursors)
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
View gist:c0b39b94443584cfc94f
$ curl -X POST localhost:8020/v1/domains -d "domain=atleastfornow.net" \
-d "soa=hawkowl@atleastfornow.net"
-u user:password
{"status": "success", "data": {"soa": "hawkowl@atleastfornow.net", "default": "active", "domain": "atleastfornow.net", "axfr": [], "id": 3}}
$ curl -X POST localhost:8020/v1/domains/3/A -d "host="
-d "target=192.168.1.1"
-u user:password
{"status": "success", "data": {"host": "", "ttl": 86000, "id": 4, "target": "192.168.1.1"}}
$ curl -X POST localhost:8020/v1/domains/3/A -d "host=www"
-d "target=192.168.1.1"
View pypiproxy.py
from klein import Klein
from twisted.python.filepath import FilePath
import logging
import time
import treq
class pypiProxyService(object):
pypiURL = "https://pypi.python.org/simple/"
You can’t perform that action at this time.