Skip to content

Instantly share code, notes, and snippets.

View dsernst's full-sized avatar
🧘‍♂️
practicing mindfulness

David Ernst dsernst

🧘‍♂️
practicing mindfulness
View GitHub Profile
@dsernst
dsernst / camphor.scss
Created August 17, 2020 02:51 — forked from bdno86/camphor.scss
camphor
$camphor300:'d09GMgABAAAAAQ5UABIAAAAEn0QAAQ3tAAEZmQAAAAAAAAAAAAAAAAAAAAAAAAAAG4SkahzOKgZgFotgAIosCCIJgnMRCAqLlgCKvTwBNgIkA5lwE4GnDguZdAAEIAW7bwcgDHJb0WS0WUXZkokWaBHx4wKbY7TigANIU/t980QCGzI/IkCsdbqJZwY1ZOgWDngIamw3I43435Dd+zJ1kNmKVp/DvXNAwaNm//////////////////+/NZkMZ5cAl0CpbZ3oiwloFA5GyIWNzOYVLt1bpXPX+pABI2fo5rMZpgVYIzYqgxt92ajECqUKh2G9gaOCVRC23VSRVypHfbvb7wYcwEM25WArF0esm1yKzDixrJRdcBGtcpBZTFbFbIl8LIU4gWOnEdSITqkoGrHWJ8ywn9eVFWWk3lC6m07qp1TXntHaWp6ekYHLrFoyzOXYiQnn2kWX2zqMaFBTca25vHKndPhJV66HRhQzL9lB3OT20KGTXuFHu62wm1qzoV/iTnaiLdc8o/D7B+1O94BrjSE3cia6U1A5XNp0kHmUj8IMBaeiGaiNJV7b1csb0bq8EWYo2h1TuipR+7hmYjxeZsonGLNcmgsKp5EUDCEj9SvRyxX2uMUNfINmfNqglBYNNtjtNmdwWV2ly4uQKheyDyka2RTRoQ3IEfs+0BNcGJ4Z5AnmHNpFbCKW5PsXkAzJ6VVzzVMo0fwIUpQQT67itTNRE946/NxDashl9KuAFUbZ6yW91vObh+WAMZ1mQ1J4wotF6KXHuo65X6wSz406hW/T6XZMf/6W+HGYUxCDfhyjPaoMGcWccmbYM/H35NdHTOd79Jg0ho/BDBvRy2vcg8pHsv07UYiKrDFeqzL0Qk7qCkXLuukl2EKuR3xS6VtsLEaT0BfWoDYoQ1YvEjjT729XNMYoCX3j+2ApedBG/UHLOJ7AAnfPSqdmmePsY+522MpfPaf7kf6fIJMn0/4SE6PmuI3yjyeGjWn+1qj/ukf09DE
@dsernst
dsernst / typecheck.js
Last active April 19, 2024 08:58
Run typescript compiler in pre-commit hook
// 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
dsernst / liquid-info.md
Last active July 28, 2017 04:13
LIQUID DEMOCRACY

Liquid — Real Political Representation  
--------------------------------------  
www.liquid.vote  

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

ApprovalVotingForPresident.com

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
dsernst / get-city-by-zip.js
Created April 11, 2017 12:51
Translate zip codes into city + state
function getCityByZip(zip) {
fetch(`https://maps.googleapis.com/maps/api/geocode/json?address=${zip}`)
.then(response => response.json())
.then(response => response.results[0].formatted_address)
.then(console.log)
}

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
dsernst / Secure Internet Voting.md
Last active August 2, 2022 09:40
Secure internet voting

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

by David Ernst, www.liquid.us

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.

Goals:

@dsernst
dsernst / visualize_complex_linked_list.md
Created September 13, 2016 09:51
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
dsernst / bmndr-wiki_spam.txt
Created February 4, 2016 06:34
All the changes made to bmndr-wiki.dsernst.com
2 February 2016
(diff | hist) . . Main Page‎; 08:40 . . (0)‎ . . ‎146.185.234.48 (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 [http://www.misiworld.de/kts/burningbook/index.php 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
dsernst / comparing-git-add-all.md
Last active January 25, 2024 17:00
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:

/my-repo
  .git/
 subfolder/