Skip to content

Instantly share code, notes, and snippets.

@anotheredward
anotheredward / rl2.html
Last active August 2, 2016 02:48
CHCH.js Roguelike with basic Line of Sight
<pre id="maze"></pre>
<script>
'use strict'
const maze = [
'#########',
'#@..#####',
'###.#####',
'#...#####',
'#.#######',
'#.#...###',
@anotheredward
anotheredward / fpw.html
Created August 9, 2016 23:01
First-person Walker
<canvas id='canvas' width='1000' height='1000'>
<script>
const c = document.getElementById('canvas')
const ctx = c.getContext('2d')
const unit = 100
let player = {x: 1, y: 1}
let wall = {x: 1, y:0 }
//wall position is 1,0, wall is unit size
//wall width and height decrease linerarly with distance
@anotheredward
anotheredward / private.xml
Created August 30, 2016 00:51
Karabiner use DX footswitch for modifier keys
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>RDING</vendorname>
<vendorid>0x0c45</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>FOOTSWITCH</productname>
<productid>0x7403</productid>
</deviceproductdef>
@anotheredward
anotheredward / waikato-dcat.json
Created February 23, 2018 02:29
waikato-dcat.json
{
"@context": "https://www.data.govt.nz/catalog.jsonld",
"@id": "https://gist.githubusercontent.com/ebuckley/data.json",
"@type": "dcat:Catalog",
"conformsTo": "https://www.data.govt.nz/toolkit/schema",
"dataset":[
{
"title": "Rivers and streams: monitoring and reporting",
"description": "Waikato Regional Council regularly monitors and reports on the quality of our region's river and stream resources, and the pressures that face these waterbodies and the plants and animals that rely on them for habitat.",
"identifier": "https://www.waikatoregion.govt.nz/Environment/Environmental-information/Environmental-indicators/River-and-streams/",
@anotheredward
anotheredward / pvz.html
Created May 1, 2018 04:19
a mini Plants vs Zombies clone in HTML/JS in a couple of hours
<style>
body {
background-color: #81C4A6;
}
.grid {
margin:1em auto;
border-collapse:collapse;
}
.grid td {
cursor:pointer;