Skip to content

Instantly share code, notes, and snippets.

Avatar

Mr Speaker mrspeaker

View GitHub Profile
@mrspeaker
mrspeaker / spr2.asm
Last active Sep 27, 2020
spr-spr-collision irq
View spr2.asm
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 Sep 19, 2020
sprite collision
View spr.asm
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 Mar 21, 2021
"require(...).print is not a function" fix for org-babel:js
View org-babel-js-fix.org

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);
View lambda_pairs.js
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)));
View gistzen.txt
I now only communicate via gists.
@mrspeaker
mrspeaker / no-background.md
Last active Feb 3, 2017
Websites without background-color
View no-background.md

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!

View getStream.js
/*
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 Aug 2, 2015
Plain functions as RxJS Subjects
View RxFuncSubject.js
import Rx from 'rx';
const RxFuncSubject = () => {
const subject = Object.assign(
(...args) => subject.onNext(...args),
Rx.Observable.prototype,
Rx.Subject.prototype);
Rx.Subject.call(subject);
View index.html
<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>