Skip to content

Instantly share code, notes, and snippets.

View mrspeaker's full-sized avatar

Mr Speaker mrspeaker

View GitHub Profile
@mrspeaker
mrspeaker / spr2.asm
Last active September 27, 2020 21:44
spr-spr-collision irq
BasicUpstart2(entry)
entry:
sei
jsr init_sprites
lda #$7f
sta $dc0d // Disable CIA #1
lda #%11110100 // Enable sprite collision irq
@mrspeaker
mrspeaker / spr.asm
Created September 19, 2020 23:02
sprite collision
BasicUpstart2(entry)
entry:
sei
jsr init_sprites
lda #$7f
sta $dc0d // Disable CIA #1
lda $dc0d
@mrspeaker
mrspeaker / org-babel-js-fix.org
Last active November 16, 2022 10:35
"require(...).print is not a function" fix for org-babel:js

Org-babel-js fix

When evaluating this code in an org-mode document:

const sq = x => x * x;
const cube = x => sq(sq(x));
return cube(4);
@mrspeaker
mrspeaker / lambda_pairs.js
Created January 24, 2019 14:31
lambda pairs
let cons = (x, y) => f => f(x, y);
let car = p => p((x, y) => x);
let cdr = p => p((x, y) => y);
let p = cons("a", cons("b", "c"));
console.log(car(p), cdr(cdr(p)));
I now only communicate via gists.
@mrspeaker
mrspeaker / no-background.md
Last active February 3, 2017 20:16
Websites without background-color

No Background-color List of Shame

Noblos.

A list of sites that don't set the css background-color property but do set the font color. Or do set the background-color but don't set the font color. That is, it wasn't done by choice.

browsersettings

Change the default colors in your browser, and the internet goes bananas. Modifying defaults is not unreasonable - switching black and white can help readablilty at night, and stops the bright flash-of-unstyled-content as a page is loading. It also messes up a web page's design if someone forgets to include basic css properties!

/*
getStream(callback) : Get a stream of items.
Each item get passed in to the provided callback.
Each item is an object with following format:
{
id: Number,
title: String
date: Number (timestamp in ms)
imageURL: String
@mrspeaker
mrspeaker / RxFuncSubject.js
Created August 2, 2015 16:19
Plain functions as RxJS Subjects
import Rx from 'rx';
const RxFuncSubject = () => {
const subject = Object.assign(
(...args) => subject.onNext(...args),
Rx.Observable.prototype,
Rx.Subject.prototype);
Rx.Subject.call(subject);
@mrspeaker
mrspeaker / index.html
Last active August 29, 2015 14:26
Rx streams
<button class='refresh'>refresh</button>
<div>
<div id='s1'><span class='name'></span><span class='x'>X</span></div>
<div id='s2'><span class='name'></span><span class='x'>X</span></div>
<div id='s3'><span class='name'></span><span class='x'>X</span></div>
</div>