Skip to content

Instantly share code, notes, and snippets.

View JeffreyBPetersen's full-sized avatar

Jeff Petersen JeffreyBPetersen

View GitHub Profile
@JeffreyBPetersen
JeffreyBPetersen / shialignment.html
Last active September 11, 2015 02:38
Threw this together to generate a phone background for a friend.
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1, user-scalable=0">
<style>
body {
margin: 0;
padding: 0;
}
img {
// thoughts on how this might work, not tested
contract SimplePublicLedgerConcept {
struct Update {
string field;
string newValue;
string oldValue;
uint timeUpdated;
}
@JeffreyBPetersen
JeffreyBPetersen / experiment.sol
Created May 10, 2016 23:56
gas cost experiment
contract Experiment {
mapping (bytes32 => string) keyValueStore;
string single;
function setKeyValue(string key, string value){
keyValueStore[sha3(key)] = value;
}
function updateSingleValue(string value){
please answer this security question whats my name
my first half is what it is my second half is half of what made it
AGMS x2
BHNT x3
CIOUV
EKQXZ
FLRY
tetragon: false
stars
<!doctype html>
<html>
<head>
<!--
get web3.js from here: https://raw.githubusercontent.com/ethereum/web3.js/master/dist/web3.js
and put it in the same directory as this. GitHub blocks using it directly.
-->
<script src='web3.js'></script>
</head>
<body>
<!doctype html>
<html>
<head>
<style>
body {
background-color: #EEF;
margin: 4em;
max-width: 64em;
}
</style>
// use account addresses as signing keys
// include dates with signatures
// automatically handle and enforce key expirations once declared
contract DigitalSignatureManager {
// given a cryptographic hash of a document, store who has signed it and when
mapping (bytes32 => mapping (address => uint)) public datedSignatures;
// whether a signing key has been revoked and when, 0 for unrevoked
{
"nonce": "0xdeadbeefdeadbeef",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x400",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": {
/* added to blankslate.io using stylebot on chrome */
html, button, input, select, textarea {
background-color: #000;
color: #DDD;
}
.status-bar {
background-color: #000;
color: #464646;
@JeffreyBPetersen
JeffreyBPetersen / DemocraticMembershipPublishingGroup.sol
Last active June 12, 2016 21:40
Draft contracts for creating lists which members can publish to and that can be joined with majority approval of existing members.
/*
draft
would benefit from getters for all variables in production version
*/
contract PublishingListRecord {
struct Post {
address poster;
string content;