Skip to content

Instantly share code, notes, and snippets.

Tobias Wooldridge TobiasWooldridge

Block or report user

Report or block TobiasWooldridge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Primes.java
import java.util.ArrayList;
import java.util.BitSet;
/**
* Created by Tobias on 24/04/2015.
*/
public class Primes {
public static interface Solution {
String getAlgorithm();
View gist:77a834a09e464ea6d37f
It would be neat if you could start a timer on a phone using it's camera and pointing it at an electronic device with a countdown on it.
e.g.
1. Take a photo of a microwave
2. OCR photo
3. Wait 1s
4. Take a photo of a microwave
5. OCR photo
6. Compare the textual results of the two and start a timer based on that (e.g. 2:00 and 1:59 would indicate the timer should start counting down from 1:59 minutes)
View gist:8fe392aee003edec9f2a
### Keybase proof
I hereby claim:
* I am tobiaswooldridge on github.
* I am thw (https://keybase.io/thw) on keybase.
* I have a public key whose fingerprint is AD12 140D 0133 8F8E EBA0 491A 819A 1A6C 41A6 8AA2
To claim this, I am signing this object:
@TobiasWooldridge
TobiasWooldridge / gist:22f0cdca75190b9a473f
Last active Oct 18, 2019
How to Unbrick a Kindle Paperwhite
View gist:22f0cdca75190b9a473f

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200
View html2facebook
function canvasToBlob(canvas) {
var imageBase64 = canvas.toDataURL();
var imageBinaryString = atob(imageBase64.split(',')[1]);
var imageBinary = new Uint8Array(imageBinaryString.length);
for (var i = 0; i < imageBinaryString.length; i++) {
imageBinary[i] = imageBinaryString.charCodeAt(i);
}
return new Blob([new Uint8Array(imageBinary)], {type: 'image/png'});
View ActivityTrackerService.java
package tw.tobias.reviveandsurvive;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;
import com.google.android.gms.location.ActivityRecognitionResult;
import com.google.android.gms.location.DetectedActivity;
View stalk.py
from Uni import *
import time
servers = CSEM.loadServers(["lofty"])
def notify(title, subtitle, message):
sh.Command("terminal-notifier")("-title", title, "-subtitle", subtitle, "-message", message)
# Get all users on every server
View stalk.py
from Uni import *
import time
servers = CSEM.loadServers(["lofty"])
def notify(title, subtitle, message):
sh.Command("terminal-notifier")("-title", title, "-subtitle", subtitle, "-message", message)
# Get all users on every server
View WorkshopPart1.js
describe("Part 1", function () {
describe("add", function() {
it("calculates that 3 + 4 = 7", function () {
expect(add(3, 4)).toBe(7);
});
});
describe("mul", function() {
it("calculates that 3 * 4 = 12", function () {
expect(mul(3, 4)).toBe(12);
View 1.js
describe("Part 1", function() {
it("add calculates that 3 + 4 = 7", function() {
expect(add(3, 4)).toBe(7);
});
it("mdul calculates that 3 * 4 = 12", function() {
expect(mul(3, 4)).toBe(12);
});
it("identityf returns its argument", function() {
You can’t perform that action at this time.