Skip to content

Instantly share code, notes, and snippets.

View pipermerriam's full-sized avatar

Piper Merriam pipermerriam

  • Ethereum Foundation
  • Boulder Colorado
View GitHub Profile
contract SomeLib {
uint value;
function getValue() returns (uint) {
return value;
}
function setValue(uint _value) {
value = _value;
}
contract AlarmAPI {
/*
* Account Management API
*/
function accountBalances(address account) public returns (uint);
function withdraw(uint value) public;
/*
* Authorization API
*/
var n_source = eth.compile.solidity("contract naive { mapping (bytes32 => int) intRegister; function registerInt(bytes32 key, int value) external { intRegister[key] = value; } function returnInt(bytes32 key, int value) internal { msg.sender.call(bytes4(sha3(\"registerInt(bytes32,int)\")), key, value); } function makeKey(address callee, bytes32 funcName, bytes32 argsHash) internal returns (bytes32 key) { return sha3(block.blockhash(block.number), callee, funcName, argsHash); } } contract Sub is naive { function add(bytes32 key, int a, int b) external returns (int sum) { sum = a + b; returnInt(key, sum); return sum; } } contract Master is naive { function delegated(address to, int a, int b) external returns (int sum) { bytes32 argsHash = sha3(a, b); bytes32 key = makeKey(to, \"add\", argsHash); to.call(bytes4(sha3(\"add(bytes32,int,int)\")), key, a, b); return intRegister[key]; } }");
var n_master = n_source.Master;
var n_masterContract = eth.contract(n_master.info.abiDefinition);
var m_addr = "0x45b9bb86b94ae
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
"""
https://m.whitehouse.gov/blog/2015/05/17/hello-world
Alice and Bob are playing a game. They are teammates, so they will win or lose
together. Before the game starts, they can talk to each other and agree on a
strategy.
When the game starts, Alice and Bob go into separate soundproof rooms – they
cannot communicate with each other in any way. They each flip a coin and note
whether it came up Heads or Tails. (No funny business allowed – it has to be

Keybase proof

I hereby claim:

  • I am pipermerriam on github.
  • I am pipermerriam (https://keybase.io/pipermerriam) on keybase.
  • I have a public key whose fingerprint is 428A BA21 DD6D FC21 93E7 29D6 8D22 65D5 CEBE 822F

To claim this, I am signing this object:

{
   "Statement":[
      {
         "Effect":"Allow",
       
         "Action":[
            "s3:ListAllMyBuckets"
         ],
         "Resource":"arn:aws:s3:::*"
      },
#greenfield customersUPDATE accounts_account
SET treatment_group_info_id = 2,
treatment_start_at = '2013-07-01'
WHERE base_account_ptr_id IN
(
SELECT id
FROM accounts_baseaccount
WHERE unique_id IN (0009147791,0022010493,0033361590,0035653573,0037780635,0044655192,0047876755,0049146796,0049571940,0071065195,0071434645,0074803866,0077358037,0662234728,0677563370,0707681758,0744021690,0767348621,0817655299,0887581777,0890104444,1000418950,1013700556,1049316306,1092207087,1161816870,1167014058,1239396850,1257974530,1272317504,1282730199,1284981550,1293983839,1312529759,1372450962,1372462720,1404999703,1437913580,1481373336,1504839900,1525395878,1547115623,1624937409,1669153405,1675646537,1711363326,1726435508,1830917506,1831184323,1876165393,1944378724,1966608865,1968382453,2003670060,2050577405,2075500188,2136251620,
2199590355,
2216208876,
class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ('email', 'name', 'avatar')
        read_only_fields = ('email',)

class AdminUserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
@pipermerriam
pipermerriam / export_shifts.py
Created May 26, 2014 00:06
shift_export.py
import datetime
import operator
import functools
import os
from unicodecsv import UnicodeWriter
from django.contrib.auth import get_user_model
User = get_user_model()