Less Wrong Than Yesterday

Adjusting Phoenix+Elm tutorials, given Elm 0.17

There are a number of tutorials on how to add Elm to Phoenix apps. Many were for Elm 0.16. They're broken for Elm 0.17. This repo will help you translate from then to now.

Here are pointers to the files that matter. In all cases, look for "elm":

My (trivial) use of Elm is in the root page.

You might also be interested in the brunch-config and .gitignore files.

Continue Reading...

Adding bootstrap.js to default Phoenix installation

This note applies to Phoenix 1.2.0

mix phoenix.new starts you out with Twitter's bootstrap. However, it only includes the CSS, not the JavaScript. I had a good deal of trouble figuring out how to get that working, not being familiar with the JavaScript ecosystem or the brunch build tool that Phoenix uses.

Thanks to the kind help of OvermindDL1, I got it working. Here are the changes, shown in the github diffs.

Continue Reading...

My introduction to metrics

I started my first post-college job in 1981, working at a startup spun off from the University of Illinois. My first job as a Unix and C programmer was to write a program to count lines of code and comment in C programs.

My first release drew complaints. Some people used K&R-style placement of blocks, as in:

if (a = 5) {  
}

But some used the Proper Style:

if (a = 5)  
{
}

The former complained that the latter got "credit" for three lines of code, while they only got credit for two.

I had to add an option (-} as I

Continue Reading...

An example of many-to-many associations in Ecto and Phoenix

Warning: I am a novice at Elixir, Phoenix, and Ecto. I'll update this post as I am corrected. Note also that this applies to Phoenix 1.2.0 and Ecto 2.0.2.

Updated: July 11. There is no need for a join table model. See also this post from OvermindDL1.

Phoenix and Ecto have recently (I gather) gotten explicit support for many-to-many associations (via join tables). I found that making them work was uncharacteristically hard, hence this blog post.

Note: my job was probably made harder because I didn't want to make the join table a first class model

Continue Reading...

Why I knee-jerkedly favor decentralized over centralized communications

(This post is pursuant to a discussion on twitter.)

Amongst humans, centralized communication, centralized knowledge, centralized control, and centralized power seem to go together. That makes sense, as a lot of what Power is, in these times, is the ability to define what's acceptable discourse: what things are worth talking about, and how they should be talked about.

My history with Power has not been good. I tend to be the person talking about the wrong thing, often in the wrong way.

Therefore, in any group I will tend do better if there's less centralization1.

So my bias toward

Continue Reading...