Skip to content

Instantly share code, notes, and snippets.

@Jonty
Jonty / flip.py
Created Feb 21, 2014
IRCCat (using command_runner) command for table flipping.
View flip.py
#!/usr/bin/python
# coding=utf8
import sys
import upsidedown
if len(sys.argv) != 6:
sys.exit()
table_string = upsidedown.transform(sys.argv[5])
output = u"(╯°□°)╯︵ ┻━" + table_string + u"━┻"
View osc_delay.py
#!/bin/env/python
import socket
import string
import time
recieve_address = ('0.0.0.0', 12000)
send_address = ('127.0.0.1', 9998)
# Set a mapping to -1 to ignore messages
# Set a mapping to 0 to pass them through rather than delaying
View osc_save.py
#!/bin/env/python
import socket
import string
import time
recieve_address = ('0.0.0.0', 12000)
listen = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
listen.bind(recieve_address)
View random_tree.py
import random
class Node:
def __init__(self, children):
self.children = []
root = Node([])
nodes_to_process = [root]
count = 0
@Jonty
Jonty / emf_cfp_email.txt
Created Jul 14, 2014
Electromagnetic Field 2014 Call For Participation
View emf_cfp_email.txt
Hello!
Electromagnetic Field (EMF) is a volunteer-run non-profit maker/hacker camping festival in the UK. We held our first event in 2012, and this year we're back and bigger than ever: a camping festival with over 1200 people of all ages, just outside Milton Keynes for a long weekend between the 29th and 31st of August.
We run this event to promote people making and learning things across as many disciplines as possible. We'll take over a large field, roll out power and internet to every tent, and put on talks and workshops for three days.
If you'd like a better idea of what that looks like, our website might help:
https://www.emfcamp.org/about
Our Call For Participation is open: we're looking for people to talk or give workshops. At previous events, we've had a huge variety of talks on everything from genetic modification to electronics, blacksmithing to high-energy physics, reverse engineering to lock picking, computer security to crocheting, and quadcopters to brewing. If you'd like to talk, we'll try
@Jonty
Jonty / kvagrant.sh
Last active Aug 29, 2015
A bash alias to allow you to invoke vagrant commands on chef-kitchen created VM's.
View kvagrant.sh
function kitchenvagrant {
shopt -s nullglob
COMMAND=$1
VM=$2
BASEPATH=".kitchen/kitchen-vagrant/"
VPATH="."
if [ ! -e ".kitchen/kitchen-vagrant/" ]; then
echo "Can't find .kitchen - are you in the correct path?"
return
@Jonty
Jonty / forest.py
Created Nov 3, 2014
Stub tree updater in python for Charles
View forest.py
from threading import Thread, Timer
import socket
# Open a UDP netcat session to this with `nc -vu localhost 1337`
# It takes updates in the form "key value" and will print out the current state from the "sender" thread every 5s
state = {
}
def read_state(socket):
@Jonty
Jonty / wagesforfacebook.md
Last active Aug 29, 2015
wagesforfacebook.com is unreadable. Here's the text.
View wagesforfacebook.md

wagesforfacebook.com

Author: Laurel Ptak (http://laurelptak.com)

They say it’s friendship. We say it’s unwaged work. With every like, chat, tag or poke our subjectivity turns them a profit. They call it sharing. We call it stealing. We’ve been bound by their terms of service far too long—it’s time for our terms.

To demand wages for facebook is to make it visible that our opinions and emotions have all been distorted for a specific function online, and then have been thrown back at us as a model to which we should all conform if we want to be accepted in this society. Our fingertips have become distorted from so much liking, our feelings have gotten lost from so many friendships.

Capital had to convince us that it is a natural, unavoidable and even fulfilling activity to make us accept unwaged work. In its turn, the unwaged condition of facebook has been a powerful weapon in reinforcing the common assumption that facebook is not work, thus preventing us from struggling against it. We ar

@Jonty
Jonty / Vagrantfile
Created Mar 4, 2015
Start kitchen-vagrant VM's in headed mode
View Vagrantfile
~/.vagrant.d/Vagrantfile
Vagrant.configure('2') do |config|
config.vm.provider "virtualbox" do |v|
v.gui = true
end
end
View dorkbot_5000.txt
jonty@towel:~$ python
>>> import datetime
>>> from dateutil.relativedelta import relativedelta
>>> FIRST_DORKBOT = datetime.date(year=2001, month=11, day=7)
>>> (FIRST_DORKBOT + relativedelta(days=5000)).isoformat()
'2015-07-17'