Skip to content

Instantly share code, notes, and snippets.

View StoneCypher's full-sized avatar

John Haugeland StoneCypher

View GitHub Profile

The intent of the mechanism is to create a transfer of money from polluting providers to non-polluting providers, scaled by the amount of power they provide and the amount of pollution they create.

The proposed mechanism is as follows.

First, to save time: the measurements here are flexible and can change. It doesn't have to be per day, or per ton; it could just as easily be per week and per pound. I'm going to pick units to keep things simple.

  1. In a given day, anyone who produces one ton of carbon pollution puts a fixed amount of money into a pool.

  2. At the end of the day, anyone who put energy onto the grid shares the pool equally by proportion of energy put onto the grid.

@StoneCypher
StoneCypher / gist:4a716e7e22040d32e1df
Created April 8, 2015 16:12
this appears to be all you need
render: function () {
return (
<div className="general">
<input defaultValue={this.props.title || ""} placeholder="Title" ref="title" type="text" name="title" />
</div>
);
}
@StoneCypher
StoneCypher / gist:55563649ee1e698a451b
Last active August 29, 2015 14:18
whoops forgot to set the highlighting language
qs( [] ) -> % this says "quicksort when called with an empty list"
[];
qs( [FirstItem | ListRemainder] ) ->
SmallerThanFirst = fun(X) -> X < FirstItem end,
result = totalrows.filter(function(Row) {
// i think es6 has functional all, but i forget what it's called, so
var passing = true;
columnFilters.map(function(Column) {
if (!(Column.filter.passes(Row.item))) {
passing = false;
break;
}
});
return passing;
// use map, but, this is how to do it without map
var result = [];
for (var r=0, rCount = totalRows.length; r<rCount; ++r) {
var thisRowIsExcluded = false;
for (var c=0, cCount = totalColumns.length; c<cCount; ++c) {
var filterCriterion = totalColumns.getYourInputThingSomehowHere;
if (yourFilterFailsOn(totalRows[r].whicheverColumn, filterCriterion)) {
parse_die(DieString) -> post_d(string:tokens(DieString, "d")).
post_d([JustDie]) -> post_d(["1"], JustDie);
post_d([Count,Die]) -> post_plus([Count] ++ string_tokens(JustDie, "+")).
post_plus(Count,[Die]) -> post_plus(Count,[Die,0]);
post_plus(Count,[Die,Plus]) -> {Count,Die,Plus}.
-module(record_joy).
-export([
datum/0,
fetch/0
<!doctype html>
<html>
<head>
<style type="text/css">
html { margin: 0; border: 0; padding: 0; }
body { margin: 0; border: 0; padding: 2em 3em; }
state_loop(State) ->
receive
{change_state, NewState} -> state_loop(NewState);
{get_state, Sender} -> Sender ! {current_state, State}, state_loop(State);
stop_looping_jerk -> {ok, sadface}
end.