Skip to content

Instantly share code, notes, and snippets.

View eadz's full-sized avatar

Eaden McKee eadz

View GitHub Profile
@eadz
eadz / accounting.sql
Created February 16, 2023 04:48 — forked from 001101/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
// http://www.selfcontained.us/2009/09/16/getting-keycode-values-in-javascript/
keycode = {
getKeyCode : function(e) {