Skip to content

Instantly share code, notes, and snippets.

FTG DRV 1961 5-22-86 10:48a
JOYMOUSE DRV 2114 5-22-86 10:35a
LMOUSE DRV 2661 5-02-86 5:47p
ATTMOUSE DRV 2305 5-22-86 2:30p
CGA DRV 13008 6-24-86 8:39p
HERCULES DRV 15776 6-24-86 8:41p
EGAMONO DRV 13952 6-24-86 8:36p
EGAHIBW DRV 13952 6-24-86 8:35p
EGALORES DRV 15648 6-24-86 8:46p
EGAHIRES DRV 17536 6-24-86 8:47p
@perey
perey / gamepad-api-implementation-notes.md
Created April 10, 2022 14:26
Browser Gamepad API test and example

Firefox 98:

  • navigator.getGamepads() only contains Gamepad objects, and only for gamepads that are actually connected.
  • When handling a gamepadconnected event, the event's gamepad property is a live reference to the gamepad in question. It can be saved and used to check for future changes to the gamepad state.
  • While handling a gamepaddisconnected event, the array obtained from navigator.getGamepads() will still include the gamepad being disconnected, but will report it as having 0 buttons and 0 axes.
  • I have only ever seen index 0 be assigned to the first-connected gamepad.

Chrome 100:

  • navigator.getGamepads() contains four items, which are null until a gamepad is actually connected. (I expect this is a minimum and the array will expand if you connect five or more gamepads, but I haven't tested it.)
@perey
perey / korean_testcases.csv
Created February 10, 2018 11:44
Test cases for romanising Korean
Hangul Latin Comments
gak Initial and final ㄱ, vowel ㅏ
kkaek Initial and final ㄲ, vowel ㅐ
nyan Initial and final ㄴ, vowel ㅑ
dyaet Initial and final ㄷ, vowel ㅒ
tteo Initial ㄸ, vowel ㅓ
rel Initial and final ㄹ, vowel ㅔ
myeom Initial and final ㅁ, vowel ㅕ
byep Initial and final ㅂ, vowel ㅖ
ppo Initial ㅃ, vowel ㅗ
@perey
perey / resource.svg
Created October 21, 2017 09:39
Test case for styling of SVG <use> element referencing an external file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perey
perey / nearest_stars.html
Last active September 17, 2021 13:26
3D Star Map
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>A star map</title>
<style>
html {
background-color: black;
@perey
perey / challenge_mondrian_results.txt
Last active December 20, 2016 17:01
Mondrian Puzzle in Piet
? 200
____________________________________________________________________________________________________
| |
| |
| |
| |
| |
| |
| |
| |
@perey
perey / paint_by_prog.py
Created January 14, 2016 10:27
Line-art painter
#!/usr/bin/env python3
"""Line-art painter."""
# Copyright © 2016 Timothy Pederick.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@perey
perey / esolang0815_examples.md
Last active December 15, 2015 11:44
0815 Interpreter

Hello World

The Esolang wiki version

<:48:x<:65:=<:6C:$=$=$$~<:03:+$~<:ffffffffffffffbd:+$<:ffffffffffffffb1:
+$<:57:~$~<:18:x+$~<:03:+$~<:06:x-$x<:0e:x-$=x<:43:x-$

Explanation

@perey
perey / hexagonmake.py
Created September 18, 2015 10:04
Hexagon maker for "Beatles Songs and Hexagons" challenge
#!/usr/bin/env python3
"""Triangular code checker and hexagon builder.
http://codegolf.stackexchange.com/questions/58186/beatles-songs-and-hexagons
When run from the command line, this program accepts two filenames as
arguments. It will:
a) Check that they conform to the format specified in the challenge
b) Merge them into a hexagon and print the result to STDOUT
@perey
perey / fraction.chef
Last active August 29, 2015 14:26
Chef code for converting improper fractions to mixed numbers.
Fraction Dosa.
This recipe takes a numerator and denominator from STDIN and outputs the
mixed-number representation to STDOUT.
Ingredients.
2 cups numerator rice
2 cups denominator ukda chawal
1 cup whole part urad dal
10 teaspoons new line poha