Skip to content

Instantly share code, notes, and snippets.

View mcdee's full-sized avatar

Jim McDonald mcdee

View GitHub Profile
contract BadSplitter {
uint256 funds;
address sender;
address recipient;
// Deposit some funds in to the contract
function deposit(address other) payable {
funds = msg.value;
sender = msg.sender;
recipient = other;
SELECT lab_name, COUNT(*)
FROM (
SELECT (record ->> 'scientist_id')::BIGINT AS scientist_id
FROM measurements
WHERE
record @> '{"value_1":0}' AND
record @> '{"value_2":0}' AND
record @> '{"value_3":0}'
) m
JOIN scientist_labs AS s