Skip to content

Instantly share code, notes, and snippets.

View bwestergard's full-sized avatar

Björn Westergard bwestergard

  • Mt. Pleasant, Washington, D.C.
View GitHub Profile
@bwestergard
bwestergard / tco.js
Last active December 4, 2016 21:39
Lazy Streams in Node
"use strict";
// http://stackoverflow.com/questions/23260390/node-js-tail-call-optimization-possible-or-not
// Tested and working with node v7.2.0. Both of the following work:
// node --harmony_tailcalls tco.js
// node --harmony tco.js
const natsFrom = (n) => [n, () => natsFrom(n+1)]
const kth = ([hd, tl], k) => k === 0 ? hd : kth(tl(), k - 1)
@bwestergard
bwestergard / lxApi.js
Created December 6, 2016 16:39
lxApi
import { find, propEq, memoize, pipe, filter, toPairs, contains, map, fromPairs, concat } from 'ramda'
import { all, resolve } from 'bluebird'
const authHeader = memoize((token) => ({ Authorization: `Bearer ${token}` }))
const $http = require('http-as-promised').defaults({ resolve: 'body', json: true })
const lx = {
gateway: 'https://lanetix-gateway.herokuapp.com',
records: 'https://lanetix-records.herokuapp.com'
}
@bwestergard
bwestergard / murray_grammar.md
Last active April 10, 2017 16:43
"The Grammar of Value"

Excerpt from "The Mismeasure of Wealth", 2016

How is the Term ‘Value’ Used in Ordinary Language?

Let us do some analysis of ordinary language and try to spell out the grammar of the word ‘value’ as used in everyday talk about the kind of value that money measures. I will interpolate comments regarding Bailey’s views – which largely oppose ordinary language – as we go. In common usage we employ the word ‘value’ in phrases such as ‘the value of commodity a’ or in questions such as ‘has the value of commodity a gone up or down?’ or ‘Do commodities a and b have the same value?’ The ordinary usages of the term ‘value’ include the following features:

  1. Value is public [Footnote: Prices, the necessary form of expression of value according to Marx, are public]. To talk about ‘value for me’ disregards the grammar of ‘value’ just as talk about ‘truth for me’ violates the ordinary grammar of ‘truth’. My allergy to dairy products does not mean cheese has no val
@bwestergard
bwestergard / useval.md
Created April 19, 2017 15:00
Murray on Use-Value (from "Mismeasure of Value" p9)

Paul Mattick Jr, puts the point this way, ‘Marx’s critique – his “scientific revolution” – therefore involved not merely a reworking of economic categories but the construction of another set of concepts, explicitly social and historical ones’.31 Marx is often misinterpreted or misused because his ideas are forced into conceptual moulds that he set out to break. Not all of Marx’s concepts are ‘explicitly social and historical’ in nature, however.32 Marx has a place for generally applicable concepts, such as use value or the labour process, but there is no actual production in general:

All epochs of production have certain common traits, common characteristics. Production in general is an abstraction, but a rational abstraction in so far as it really brings out and fixes the common element ... If there is no production in general, then there is also no general production.

We can make some generally applicable observations about production – for example, every labour process involves a place, objects of p

@bwestergard
bwestergard / migrateup.txt
Created December 5, 2017 20:42
Migrate up issue in records
Bjorns-MacBook-Pro:records bjornwestergard$ npm run migrate up
> records@1.1.0 premigrate /Users/bjornwestergard/env/dev/records
> npm run assert-schema records
> records@1.1.0 assert-schema /Users/bjornwestergard/env/dev/records
> pg-assert-schema -d postgres://postgres@localhost/lanetix "records"
@bwestergard
bwestergard / jan16.md
Created February 26, 2018 19:20
Lanetix Union: Email To Management (January 16, 2018)

To the management of Lanetix,

We, the software engineers of Lanetix in Washington and San Francisco, are proud to announce that we are unionizing with the News Guild (Communication Workers of America).

For many workers in our industry, hopping from firm to firm as challenges arise is a lamentable but unquestioned mode of life. Today, we demonstrate a new approach.

By organizing, we rise to the challenge of preserving and strengthening culture which has attracted an unusually diverse and distinguished team. With a collective voice on the job, we can successfully navigate the productive tensions that are part and parcel of growth in a turbulent industry.

We are united in our resolve to achieve consistency in titles and salaries, recruitment of talented staff engineers, regular raises, scheduled appraisals on an objective basis, 401k matching, just cause for termination, and rational work from home, paid time off, and overtime policies. But beyond these prosaic objectives, we aim to set a new standard for tr

@bwestergard
bwestergard / lajsl.md
Last active April 2, 2018 14:43
Language Agnostic JSON Schema Language Prior Art
@bwestergard
bwestergard / kraut.sc
Created April 20, 2018 21:02
Supercollider Krautrock
Server.default.boot;
(
SynthDef(\kick, { | sustain = 1, freq = 440 |
var snd = SinOsc.ar(XLine.ar(freq/2, freq/4, 0.05 * sustain)).dup * XLine.ar(1.1,1e-4,sustain, doneAction: 2);
Out.ar(\out.kr(0), snd * 1.9 * \amp.kr(0.1));
}).add;
)
(
@bwestergard
bwestergard / jane_letter.md
Last active August 3, 2018 22:20
Lanetix Union Dispute: November Letter Responding to Firing of "Jane"

To Mr. Troy Goode,

We, the undersigned, are Lanetix employees who have helped build a product and a company. We look back on our years of taxing effort with pride, knowing that we have pushed forward both the state of the art and the cause of a diverse, inclusive, professional software industry.

Your decision to fire [Jane] - with no warning, breaking with all past practice - shocked us. She was a valued co-worker whose contributions to the company were obvious, and to our knowledge there has never been cause to question her capabilities or performance. Her manifest intelligence, skill, and professionalism under trying circumstances were an inspiration to us all. But [Jane]'s greatest contribution to the team was her willingness to hear the grievances we shared with one another and bring them to you.

[Jane] was an effective advocate for all of us, especially for those women who joined her here in an attempt to build careers in an industry in which the deck is stacked against them. She spoke up, most visib