Skip to content

Instantly share code, notes, and snippets.

View JAForbes's full-sized avatar
🔨

James Forbes JAForbes

🔨
View GitHub Profile
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="20" columns="98" buffer_rows="500" buffer_columns="0" init_dir="C:\Users\Kevin\Desktop" start_hidden="0" save_size="1" shell="C:\Program Files (x86)\Git\bin\sh.exe --login -i">
<colors>
<color id="0" r="0" g="43" b="54"/>
<color id="1" r="38" g="139" b="210"/>
<color id="2" r="133" g="153" b="0"/>
<color id="3" r="42" g="161" b="152"/>
<color id="4" r="220" g="50" b="47"/>
<color id="5" r="211" g="54" b="130"/>
@JAForbes
JAForbes / table_literal.sql
Last active June 6, 2021 04:44
Table literal in SQLite
select * from (
-- define the column names
select 0 as a, 0 as b
-- join the definition row with all the values
union
-- define the values
values
(4,5),
@JAForbes
JAForbes / readme.md
Last active January 13, 2021 00:06
Data Driven Entity Component System

Entities and Components

An entity is just a number.

There is a graph of components, indexed by the entity id.

All state is stored in one place.

var components = { Position: {}, Velocity:{}, Spite: {}, Timer: {}, ScreenShake: {}, RemoveComponents: {} }
@JAForbes
JAForbes / readme.md
Last active August 4, 2018 23:36
A simple Javascript

Warning this is purely a thought experiment and will probably go nowhere. The language semantics will likely be incongruent and non-rigourous. Proceed at your own risk.

Philosophy

Javascript always wanted to be a functional language. But for historical, political and perhaps even sensible reasons, JS's original mission was never truly fulfilled.

But what if, we take JS and start removing things. We can remove mutation, remove variables, remove classes, remove variadic signatures, remove default arguments and on and on.

What if we go back to ES1 and re-evaluate a future unperturbed by corporate circumstance.

Keybase proof

I hereby claim:

  • I am jaforbes on github.
  • I am jaforbes (https://keybase.io/jaforbes) on keybase.
  • I have a public key ASApPkyaRmnP9bvhzSewAebZiu2h3Q3NfIYJpBcUVWLnywo

To claim this, I am signing this object:

@JAForbes
JAForbes / readme.md
Created August 22, 2021 00:52
Fake Tape

Fake Tape

I was getting a weird error in Node, it would exit randomly, I could not figure it out. There was no error or stack trace. I could not step into the line with the debugger.

I thought maybe the test runner was doing something strange. So I quickly mocked out the test runner, at least the bits I use.

It ended up being unrelated to the test runner, but I wanted to record this as its a nice simple async test runner.