Skip to content

Instantly share code, notes, and snippets.

View jeandrek's full-sized avatar

Jeandre jeandrek

  • New Zealand
View GitHub Profile
@jeandrek
jeandrek / tpe-alt-alt.user.js
Last active December 6, 2015 22:18 — forked from hyperobject/tpe-alt.user.js
A remixed remixed TPE userscript
// ==UserScript==
// @name thisandagain Summoner
// @namespace thisandagainPlsExplainThisPost
// @version 1.06
// @description Adds a button to posts to magically summon thisandagain or thisandbatman
// @author Jonathan50
// @match https://scratch.mit.edu/discuss/*
// @grant none
// ==/UserScript==
#!/usr/bin/env python3
# Jonathan50's Great Decompiler
# for Python 3
#
# http://creativecommons.org/publicdomain/zero/1.0/
# To the extent possible under law, the person
# who associated CC0 with Jonathan50's great decompiler has
# waived all copyright and related or neighboring
# rights to Jonathan50's great decompiler.
@jeandrek
jeandrek / scratch-tips-browser.user.js
Created May 1, 2016 01:47
Tips Browser for MIT Scratch
// ==UserScript==
// @name Scratch tips browser
// @namespace scratchTipsBrowser
// @version 0.1.0
// @description Tips Browser for MIT Scratch
// @author Jonathan50
// @match https://cdn.scratch.mit.edu/scratchr2/static/*/help/en/home.html
// @grant none
// ==/UserScript==
@jeandrek
jeandrek / clickbait.js
Last active May 28, 2016 08:47
Better clickbait (more clickbaity) http://jonathan50.github.io/clickbait.html
function Words(...templates) {
this.templates = templates
}
Words.prototype.generate = function() {
return this.templates.map(generate).join(' ')
}
function generate(template) {
if(template instanceof Words)
return template.generate()
@jeandrek
jeandrek / RPNy McRPNface.odt
Last active July 24, 2016 00:05
RPNy McRPNface
@jeandrek
jeandrek / streams.scm
Last active September 23, 2016 01:45
Streams library
;;;; Streams library
;;;; Copyright (c) 2016, Jeandre Kruger
;;;; All rights reserved.
;;;; Redistribution and use in source and binary forms, with or without modification,
;;;; are permitted provided that the following conditions are met:
;;;; 1. Redistributions of source code must retain the above copyright notice, this
;;;; list of conditions and the following disclaimer.
@jeandrek
jeandrek / find-function.scm
Last active November 15, 2016 04:29
Find-function – Given some input/output pairs, find a general function that works with these.
;;;; Find-function -- Given some input/output pairs, find a general function that works with these.
;;;; Copyright (C) 2016 Jeandre Kruger
;;;; All rights reserved.
;;;; Redistribution and use in source and binary forms, with or without modification,
;;;; are permitted provided that the following conditions are met:
;;;; 1. Redistributions of source code must retain the above copyright notice, this
;;;; list of conditions and the following disclaimer.
@jeandrek
jeandrek / fib.asm
Created November 19, 2017 08:06
Fibonacci for S65
@0x00
ORIGIN = 0xFF8D
==Start==
LDA #1 ; start counting at 1
{
PHA ; save A
JSR Fib
CMP 0x0200 ; if fib(A)>fib(A-1), stop
@jeandrek
jeandrek / uudecode.patch
Created March 4, 2018 05:31
Windows patch for 4.4BSD uudecode
--- ../Downloads/uudecode.c 1994-04-03 06:16:37 +1200
+++ uudecode.c 2018-03-04 18:23:50 +1300
@@ -50,8 +50,8 @@
#include <sys/param.h>
#include <sys/stat.h>
-#include <pwd.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
@jeandrek
jeandrek / extract.c
Created April 9, 2018 04:46
Extract MS-DOS 8.0 disk image
#include <stdio.h>
#include <stdlib.h>
#define SECTOR 512
#define BOOTMAGIC 0xaa55
char disk[SECTOR*2880];
int
main(int argc, const char *argv[])