Skip to content

Instantly share code, notes, and snippets.

View TobiasWooldridge's full-sized avatar

Tobias Wooldridge TobiasWooldridge

View GitHub Profile
<!--
Use the following or similar to execute JS
-->
<html>
<body>
<pre>
<script>
function log(arg) {
document.writeln(arg);
<!--
Use the following or similar to execute JS
-->
<html>
<body>
<pre>
<script>
function log(arg) {
document.writeln(arg);
<!--
Use the following or similar to execute JS
-->
<html>
<body>
<pre>
<script>
function log(arg) {
document.writeln(arg);
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() {
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);
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
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
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;
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'});
@TobiasWooldridge
TobiasWooldridge / gist:22f0cdca75190b9a473f
Last active November 13, 2024 20:47
How to Unbrick a Kindle Paperwhite

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