Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python2
# vim: set tabstop=4 shiftwidth=4 textwidth=79 cc=72,79:
"""
jpeglitcher: Read a JPEG one byte at a time,
occasionally making a mistake.
Original Author: Owain Jones [github.com/erinaceous] [contact@odj.me]
"""
from __future__ import print_function
import subprocess
@erinaceous
erinaceous / softare_uart.ino
Created October 25, 2014 14:34
arduino software serial library that doesn't use interrupts
// bits per second, measured in microseconds.
#define HALF_BIT_4800 104;
#define FULL_BIT_4800 208;
void setup() {
// ...
}
@erinaceous
erinaceous / softare_uart.c.c
Created October 25, 2014 14:22
arduino software serial library that doesn't use interrupts
// bits per second, measured in microseconds.
#define HALF_BIT_4800 104;
#define FULL_BIT_4800 208;
unsigned char uart_rx(int pin, int baud) {
unsigned char rec = 0;
// double pause = 0.0;
// vim: set tabstop=4 shiftwidth=4 textwidth=79 cc=72,79:
/*
* Video player based off hello_video.c
* Listens for commands via a FIFO file.
*
* Owain Jones <github.com/erinaceous>
*
* Original hello_video:
* Copyright (c) 2012, Broadcom Europe Ltd
* All rights reserved.
@erinaceous
erinaceous / colourfulswearing.py
Created February 20, 2014 20:25
i am very mature
#!/usr/bin/env python
# vim: set tabstop=4 shiftwidth=4 textwidth=79 cc=72,79:
"""
Not Web Safe: Exploration Of Swear Words Represented In The Hexadecimal
Colour Space, a study by Courtney Aspinall and Owain Jones
Original Author: Owain Jones [github.com/doomcat] [contact@odj.me]
"""
from __future__ import print_function
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
@erinaceous
erinaceous / decision_tree.py
Last active January 2, 2016 15:59
Decision Tree Python implementation Using CSV file available from: http://www.reversewinesnob.com/p/interactive-wine-ranking-spreadsheet.html (On embedded spreadsheet, select Menu > Download > CSV)
#!/usr/bin/env python
# vim: set tabstop=4 shiftwidth=4 textwidth=79 cc=72,79:
"""
decision_tree: Python implementation of an ID3 decision tree.
Based mostly on Chapter 18, Section 18.3 'Learning Decision Trees'
Of the book 'Artificial Intelligence: A Modern Approach'
By Russel & Norvig, 1995.
Original Author: Owain Jones [github.com/doomcat] [contact@odj.me]
@erinaceous
erinaceous / actual_aber_password.py
Last active December 30, 2015 10:19
Tiny guide for getting workable Aber passwords
#!/usr/bin/env python
"""
Password generator for Aber Uni users
Owain Jones [github.com/doomcat]
IS's systems are very picky about the passwords they let you use. It
can prove to be very difficult to come up with a password that's both
memorable and secure for it.
#!/bin/sh
# Based on
# http://blog.jamiek.it/2010/06/linux-flickr-downloader-script.html
# Searches flickr for all publicly available photos whos title/description/tags
# match the string passed to it.
# Downloads original-size images where possible, medium-size images otherwise.
# (Downloads into your current working directory)