Skip to content

Instantly share code, notes, and snippets.

View DustinWehr's full-sized avatar

Dustin Wehr DustinWehr

  • Toronto, Ontario, Canada
View GitHub Profile
@DustinWehr
DustinWehr / ballot2.v.py
Last active September 29, 2017 20:37
Viper delegated voting fixed
# Voting with delegation
# This is based on @DavidKnott's viper/examples/voting/ballot.v.py and
# https://solidity.readthedocs.io/en/develop/solidity-by-example.html#voting
# but diverges significantly due to the constraint of bounded gas cost.
# version with cycle breaking feature: https://gist.github.com/DustinWehr/d178b3a0b50dcb217a26ad1f26be82e1
# NOT YET TESTED AND PROBALY HAS BUGS.
# Information about voters
@DustinWehr
DustinWehr / ballot2_with_cycle_breaking.v.py
Last active August 31, 2017 16:52
Same as ballot2.v.py but with functions for breaking delegation cycles
# Voting with delegation and delegation-cycle breaking
# This is based on @DavidKnott's viper/examples/voting/ballot.v.py and
# https://solidity.readthedocs.io/en/develop/solidity-by-example.html#voting
# but diverges significantly due to the constraint of bounded gas cost.
# This is the simpler version without cycle breaking: https://gist.github.com/DustinWehr/b4f3e0d3b1d29a55f4c3042e0485bd69
# NOT YET TESTED AND PROBALY HAS BUGS.
# Information about voters
@DustinWehr
DustinWehr / ballot.v.py
Created October 10, 2017 15:29
ballot.v.py fixed but still simple
# Voting with delegation.
# Information about voters
voters: public({
# weight is accumulated by delegation
weight: num,
# if true, that person already voted or delegated
voted: bool,
# person delegated to
delegate: address,
{
"meta": { "theme": "kendall" },
"basics": {
"name": "Dr. Robert Dustin Wehr",
"label": "",
"picture": "https://www.cs.toronto.edu/~wehr/pro_headshot_cropped_centered.jpg",
"email": "dustin.wehr@gmail.com",
"phone": "647 238 9539",
"degree": "PhD",
@DustinWehr
DustinWehr / beeftext_to_espanso.js
Created March 4, 2021 19:20
Beeftext snippets to Espanso snippets
/*
1. Replace my snippets json with yours.
2. Copy paste this whole file into your browser console.
*/
beeftext_json = {
"combos": [
{
"creationDateTime": "2019-01-25T11:23:30.000",
"enabled": true,