Skip to content

Instantly share code, notes, and snippets.

practicing mindfulness

David Ernst dsernst

practicing mindfulness
View GitHub Profile
View camphor.scss
dsernst / typecheck.js
Last active Feb 9, 2020
Run typescript compiler in pre-commit hook
View typecheck.js
// Run this script to check our files for type errors
// using our existing tsconfig.json settings
// Usage: node typecheck.js
const fs = require('fs')
const stripJsonComments = require('strip-json-comments')
const tsConfig = JSON.parse(stripJsonComments(fs.readFileSync('./tsconfig.json', 'utf8')))
const { exec } = require('child_process')
dsernst /
Last active Jul 28, 2017

Liquid — Real Political Representation  

Reclaim your voice in government.  
Hold politicians accountable.  
Remove corruption.  

What is Approval Voting?

This is how we do it now:

Plurality voting as Radio box example

This is how we could be doing it:

dsernst / get-city-by-zip.js
Created Apr 11, 2017
Translate zip codes into city + state
View get-city-by-zip.js
function getCityByZip(zip) {
.then(response => response.json())
.then(response => response.results[0].formatted_address)

Goal: An algorithm to calculate an elected legislator's "Representation Score".

Legislative agenda

We have a set of legislative bills, uniquely identified with keys like "2016-11-01-160553" or "2017-03-07-170089", that are the agenda items of a jurisdiction's legislature.

The set grows by 40 bills per week on average. As of 2017-03-12, it has 602 elements.

Each bill has a 1-week window in which it can be voted upon by the citizens in the jurisdiction via the Liquid platform.

Voter registration

dsernst / Secure Internet
Last active Oct 11, 2018
Secure internet voting
View Secure Internet

Proof-of-Vote: A Simple Cryptosystem for Secure Internet Voting

by David Ernst,

A method to democratically vote online, that provably ensures to the individual voter that their vote was cast and counted correctly, without tampering, while still protecting their vote privacy.

Note: This is designed for our issue-based liquid democracy platform, not traditional elections.


dsernst /
Created Sep 13, 2016
How to arrange a complex linked list? For visualizing Liquid Democracy

How to arrange a complex linked list?

Given a singly linked list like this:

    uid: 'a',
    full_name: 'Angela Augustine',
    next: 'c',
dsernst / bmndr-wiki_spam.txt
Created Feb 4, 2016
All the changes made to
View bmndr-wiki_spam.txt
2 February 2016
(diff | hist) . . Main Page‎; 08:40 . . (0)‎ . . ‎ (Talk)‎ (aOuwuMqXkNyjSsUaI)
1 February 2016
(diff | hist) . . N Real-World repo software Systems - Insights‎; 19:06 . . (+3,353)‎ . . ‎ReggieAlcala2 (Talk | contribs)‎ (Created page with "Designs are usually obtainable in many diverse designs including high end, signature and compact products, all of which offer excellent worth and fantastic quality. There are ...")
(diff | hist) . . N User:ReggieAlcala2‎; 19:06 . . (+177)‎ . . ‎ReggieAlcala2 (Talk | contribs)‎ (Created page with "Hi there! :) My name is Carissa, I'm a student studying Film Studies from Sandefjord, Norway.<br><br>my website [ Repo Software]")
(diff | hist) . . N Speedy Systems Of repo software‎; 17:03 . . (+3,044)‎ . . ‎TerrellMcLoud (Talk | contribs)‎ (Created page with "There is an excellent consumer protection act in the state of California called the Song-Beverly Consumer Warranty Act, mostly referred to as the
dsernst /
Last active Feb 20, 2021
Compare `git add .` vs `git add -A`

git add . vs git add -A

Both of these will stage all files, including new files (which git commit -a misses) and deleted files.

The difference is that git add -A also stages files in higher directories that still belong to the same git repository. Here's an example: