Skip to content

Instantly share code, notes, and snippets.

@richardjpope
richardjpope / gist:4452689
Last active December 10, 2015 15:09
Oyster Card backup script for ScraperWiki.com Vault
# This is a very basic script to backup oyster card data to a scraperwiki vault
# Notes:
# 1) You need an oyster card that has been registered on tfl.gov.uk
# 2) This script requires you to enter your username and password (this about what that means before progressing, and do so at your own risk)
# 3) This script should be run in a PRIVATE SCRAPERWIKI VAULT ONLY https://scraperwiki.com/pricing/ not a public scraper, or the world will know your password
import scraperwiki
import mechanize
import lxml.html
from lxml.etree import tostring
@SlexAxton
SlexAxton / .zshrc
Last active March 24, 2025 17:35
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@rvagg
rvagg / README.md
Last active February 24, 2025 11:41
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.

Accept no meetings days

I operate a policy of having days in which I try hard to not have meetings. If you're reading this, chances are you've looked at my calendar and are wondering what kind of meeting takes all day and happens so frequently. It's not an actual meeting, it is a reservation of the day.

When you're operating on the maker's schedule, meetings are a disaster. A single meeting can blow a whole afternoon, by breaking it into two pieces each too small to do anything hard in.

Maker's Schedule, Manager's Schedule by Paul Graham

If you still need to book a meeting with me on a reserved day, go ahead. I'll accept it if I think it's more important than having time for coding and thinking and solving hard problems.

@andrewn
andrewn / gist:6352695
Last active December 21, 2015 19:09
USB Soundcard default
To make a USB souncard default:
1. Open `sudo nano /etc/modprobe.d/alsa-base.conf`
2. Comment out the following line: `#options snd-usb-audio index=-2`
3. Reboot
4. Check that USB audio is at the top of this list `cat /proc/asound/modules`
@chrisfinch
chrisfinch / gist:6367108
Created August 28, 2013 15:06
Gruntfile require.js optimisation config
// r.js concatenation and minification of javascript
requirejs: {
compile: {
options: {
name: "almond",
baseUrl: "lib/js/",
include: ['main'],
exclude: ['jquery'],
mainConfigFile: "lib/js/main.js",
out: "build/js/peaks.min.js",
@daxadax
daxadax / burgerbot.rb
Last active April 13, 2022 09:20
burgerbot
#!/usr/bin/env ruby
# modified from https://gist.github.com/pbock/3ab260f3862c350e6b5f #
require 'watir-webdriver'
class BurgerBot
def initialize
@attempt_count = 0
@mjackson
mjackson / app.js
Created December 29, 2015 05:07
Using webpack with pixi.js
var PIXI = require('pixi.js')
console.log(PIXI)
@gbaman
gbaman / HowToOTGFast.md
Last active April 30, 2025 02:59
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@harryfk
harryfk / mail.js
Last active January 29, 2017 22:31
// this is a Google Apps script which fetches a random gif from Giphy and then sends it via email to people
function sendMail(){
var url = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=thanks";
var response = UrlFetchApp.fetch(url, {}).getContentText();
response = JSON.parse(response);
var subject = 'Your friendly time tracking reminder.';
var body = 'Please, would you track your time today? It only takes five minutes.\n\n ';
var sender = 'Annoying Harry';