Skip to content

Instantly share code, notes, and snippets.

View justinvh's full-sized avatar
😀

Justin Bruce Van Horne justinvh

😀
  • SpaceX
  • New York, New York
  • 08:52 (UTC -04:00)
  • LinkedIn in/justinvh
View GitHub Profile
@justinvh
justinvh / proof.md
Last active December 20, 2024 20:43
proof.md

openpgp4fpr:4DF006B644AAC7DF816DE059E9E2EA5077277E7C

int main() {
short x = 42;
short y = 25;
switch (x) {
short x = 42;
short y = 25;
case 42: return y;
case 84: return y;
default: return y;
}
@justinvh
justinvh / shift_mousewheel_hscroll.ahk
Created October 10, 2018 22:34
Horizontally scroll with shift + mousewheel
; Shift + Wheel for horizontal scrolling
+WheelUp::
; Scroll to the left
MouseGetPos,,,id, fcontrol,1
Loop 8 ; <-- Increase for faster scrolling
SendMessage, 0x114, 0, 0, %fcontrol%, ahk_id %id% ; 0x114 is WM_HSCROLL and the 0 after it is SB_LINERIGHT.
return
+WheelDown::
;Scroll to the right
MouseGetPos,,,id, fcontrol,1
@justinvh
justinvh / dialog_choices.toml
Last active June 29, 2018 07:29
dialog_choices.toml
[1]
speaker = "raptor-lady"
expression = "Afraid"
name = "Trapped Dinosaur"
text = "You, Mr. Raptor, can you help?"
[1.1]
evil_requirement = 10
name = "Mr. Raptor"
expression = "Angry"
template <typename T>
struct extract_return_type: std::false_type {};
template<typename A, typename B>
struct extract_return_type<A(B::*)> { typedef A return_type; typedef B class_type; };
template <class Accessor>
struct AccessorComparator {
Accessor a1, a2;
typedef typename extract_return_type<Accessor>::class_type Object;
@justinvh
justinvh / prelude.ts
Last active August 17, 2016 03:53
prelude-ideas
type MaybeIterator<T> = IterableIterator<T> | T[];
function *iter<A>(a: A[]): IterableIterator<A> {
yield* a;
}
function isIter<A>(a: MaybeIterator<A>): a is IterableIterator<A> {
return (<IterableIterator<A>>a).next !== undefined;
}
@justinvh
justinvh / mvm.js
Created May 22, 2016 18:23
Move vs Move Melee
WINS
{'falco': {'falcon': 78,
'fox': 39,
'marth_tip': 41,
'peach': 48,
'puff': 44,
'sheik': 17,
'total': 267},
'falcon': {'falco': 20,
'fox': 31,
@justinvh
justinvh / test.js
Created May 22, 2016 18:18
How top characters in Melee beat each other per move
WINS
{'falco': {'falcon': 1,
'fox': 1,
'marth_tip': 0,
'peach': 1,
'puff': 2,
'sheik': 0,
'total': 5},
'falcon': {'falco': 0,
'fox': 2,
var getWord = function (database, callback) {
random_word_request(function (data) {
var word = data.word;
// If the word exists, find again
if (database.find(word)) {
return getWord(database, callback);
}
database.push(word);
const uint8_t gamecube_pin = PD0;
const uint8_t gamecube_prefix = 25;
const uint8_t gamecube_bitcount = 64;
unsigned char data[gamecube_bitcount + gamecube_prefix];
#define PIN_READ(pin) (PIND & (1 << pin))
#define TWOMICROSECOND_NOPS "nop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\n"
#define WAIT_FALLING_EDGE(pin) while(!PIN_READ(pin)); while(PIN_READ(pin));