One of the challenges I saw with Archaeopteryx: programmers got so excited about the code side of it, they distracted me from the actual instrumentalist aspect.
This is awesome. And so is this. But so is this:
Wednesday, May 8, 2013
Saturday, May 4, 2013
Stop Drawing Dead Fish
Another brilliant presentation from Bret Victor. The spirit of Xerox Parc remains alive, and then some; he transfers, to animation, the machine control as performance dynamic which characterizes DJing. Very highly recommended.
Tuesday, April 23, 2013
Monday, April 22, 2013
Stop CISPA
If CISPA becomes law, the government can spy on you without a warrant.
If CISPA becomes law, when the gov't downloads your private information, you'll never even know.
If CISPA becomes law, it makes it so companies can’t be sued when they do illegal things with your data.
If CISPA becomes law, it makes every privacy policy on the web useless and violates the 4th amendment.
Remember, there are more of us than there are of them. If we stick together we can stop CISPA once and for all.
If CISPA becomes law, when the gov't downloads your private information, you'll never even know.
If CISPA becomes law, it makes it so companies can’t be sued when they do illegal things with your data.
If CISPA becomes law, it makes every privacy policy on the web useless and violates the 4th amendment.
Remember, there are more of us than there are of them. If we stick together we can stop CISPA once and for all.
Sunday, April 21, 2013
New Track On SoundCloud: "Willfully Obtuse"
It's a leftfield drum and bass track with an indie rock feel to it.
Probably very influenced (unintentionally) by this Diiv song.
Probably very influenced (unintentionally) by this Diiv song.
Sunday, April 14, 2013
Thursday, April 11, 2013
A Hello World In Ember.js
I saw several blog posts with inaccurate code for a 'hello world' in Ember. Here's code which actually works:
Loading this file gets you an "index" (default) view with a "hi" link, and clicking that link gets you to "hello world!".
I'm a little embarrassed about 'index' as a naming choice, because it's a bad habit, but I got it from the framework. Ember uses 'index' to mean 'default view,' the same way Rails controllers do. This probably came to Ember from Rails, and came to Rails from Apache, but it really has nothing to do with indexing whatsoever. It's one of the few completely cargo-cult elements in Rails, so it's not my favorite part of Ember either.
However, one thing I do want to give Ember credit for, which you can see in this example: this code's concise. In fact it could be a lot more concise; that 'index' route doesn't actually need to be there. Like a lot of things, Ember supplies it automatically.
So this is better:
And also:
Loading this file gets you an "index" (default) view with a "hi" link, and clicking that link gets you to "hello world!".
I'm a little embarrassed about 'index' as a naming choice, because it's a bad habit, but I got it from the framework. Ember uses 'index' to mean 'default view,' the same way Rails controllers do. This probably came to Ember from Rails, and came to Rails from Apache, but it really has nothing to do with indexing whatsoever. It's one of the few completely cargo-cult elements in Rails, so it's not my favorite part of Ember either.
However, one thing I do want to give Ember credit for, which you can see in this example: this code's concise. In fact it could be a lot more concise; that 'index' route doesn't actually need to be there. Like a lot of things, Ember supplies it automatically.
So this is better:
And also:
@gilesgoatboy you can leave off the { path: ‘/hi’ } and the nested function in your final example and everything will still work :D
— Yehuda Katz (@wycats) April 12, 2013
Rewind: Analyzing Git History With Bash
Rewind is a small library of git analysis scripts in Ruby and bash. Its goal is to quickly extract meaningful context from the enormous amount of historical data which any git project provides.
One use case: you want to compare the respective authorship patterns of two forks of a library from GitHub. Maybe your company has a local gem forked from a popular gem, and you want to figure out how many unique changes your fork has.
Another use case: you're looking at a large library with a lot of files, and you've been told this library has a lot of technical debt. One way to track down technical debt is to find the files which a) have the largest number of lines of code, and b) have the largest number of commits. Conversely, if you see a very small file with a very large number of commits in its history, people have probably refactored that file a lot.
Rewind gives you numbers; you have to use good judgement to get useful insights from those numbers.
One use case: you want to compare the respective authorship patterns of two forks of a library from GitHub. Maybe your company has a local gem forked from a popular gem, and you want to figure out how many unique changes your fork has.
Another use case: you're looking at a large library with a lot of files, and you've been told this library has a lot of technical debt. One way to track down technical debt is to find the files which a) have the largest number of lines of code, and b) have the largest number of commits. Conversely, if you see a very small file with a very large number of commits in its history, people have probably refactored that file a lot.
Rewind gives you numbers; you have to use good judgement to get useful insights from those numbers.
How I Made ~2,340% Profit With Bitcoin And Trivial Code
The other day, right before the latest Bitcoin price spike crashed, I sold half a Bitcoin for about $117.89. I had bought this Bitcoin for about $10, so I think my math is very approximately correct when I call that a 2,340% profit. A 100% profit on a $5 investment would have been another $5.
In other words, I sold at the height of a bubble. Lucky me. But the answer is not just luck. The answer is shell-scripting the web.
Two years ago, I wrote a simple Ruby script to screen-scrape Bitcoin prices (in USD) and create a simple web page with the latest price. Then I plugged that into an hourly cron job and wired up the DNS for btcusd.gilesb.com. I didn't do it because I actually cared very much about Bitcoin prices. What I did care very much about was not looking at the hideous price-tracking web sites which existed at the time. I was too used to plugging my currency conversions into Google searches, but you couldn't do that for Bitcoin yet at the time (and maybe you still can't).

However, after I built this little mini-app, because of a very useful side effect, I saw its one tiny web page every single day, several times a day, and in the process developed a very detailed intuitive feel for the volatility of Bitcoin prices. And then, when I sold my Bitcoin, I just happened to do it very close to the peak of the latest bubble. Coincidence?
Here's how the side effect happened. At the time I wrote btcusd.gilesb.com, Safari was my only web browser on my iOS devices, and iOS Safari has a number of very poorly-conceived quirks, the worst being that any time you open it on an iPhone, it will idiotically jump to your Bookmarks, as if bookmarks were a feature which normal people ever even use. I began developing muscle memory for the task of closing the bookmarks and switching to the search field, but it struck me what a terrible maladaptation that was, so I decided to do something else instead.
I developed a simple habit for my iPhone of always keeping a web page open which had a simple DOM and a very fast page-loading time. (DOM simplicity can be more important than actual network loading speed when it comes to perceived performance.) I chose Hacker Newspaper for this purpose.
Hacker Newspaper is a miniapp like btcusd.gilesb.com, but for Hacker News, which I had written a few years earlier. I wrote it because Hacker News makes (in my opinion) terrible and obvious mistakes in typography, color theory, and web application performance, as well as terrible but subtle mistakes in application design. Anyway, Hacker Newspaper loads very quickly and renders very quickly, because it features a simple DOM, and very few external assets, so it got me around the usability fail in iPhone Safari. But btcusd.gilesb.com loads and renders even more quickly, with an extremely simple DOM, zero external assets, and also zero distracting links, so I made that my default launch page for Safari on the iPhone instead.
That was in 2011. It's 2013. I've seen the Bitcoin price fluctuating nearly every day since then, sometimes very many times per day. I've never given it a lot of attention, but I didn't have to. I've developed an enormous amount of context for Bitcoin prices as a side effect. (This is why I firmly believe you have to be judicious about what information you consume, both actively and passively.)
Anyway, my massive profit percentage is in fact just a tiny sliver of actual dollars. However, what I plan to do is continue using btcusd.gilesb.com this way, and buy BTC again when I feel they've hit a low. I'm willing to trust my intuition in this regard because I've developed it against a lot of data. Although this is just intuition, I expect the price to dip quite a bit at some point in the future, and I have very logical reasons to expect that I'll be among the first to know if/when that happens. Having tested this system with a small amount of money, I'm willing to experiment with a larger amount next time.
Of course this is not financial advice, and although I think some sane solution for Bitcoin and taxes will emerge, this is not legal advice either. But it is programming advice. You should shell-script the web. Hacker News annoyed me, so I fixed it with a tiny mini-app, really not much more than a shell script. Google didn't extend its automatic currency conversion to BTC, so I fixed that with a tiny mini-app too, again not much more than a shell script. And then I used that shell script mini-app to avoid Apple UX fail, and made an absurd profit percentage as a side effect.
Shell script all the things. The web is full of broken. Fixing even the little problems can accidentally net you huge profits.
In other words, I sold at the height of a bubble. Lucky me. But the answer is not just luck. The answer is shell-scripting the web.
Two years ago, I wrote a simple Ruby script to screen-scrape Bitcoin prices (in USD) and create a simple web page with the latest price. Then I plugged that into an hourly cron job and wired up the DNS for btcusd.gilesb.com. I didn't do it because I actually cared very much about Bitcoin prices. What I did care very much about was not looking at the hideous price-tracking web sites which existed at the time. I was too used to plugging my currency conversions into Google searches, but you couldn't do that for Bitcoin yet at the time (and maybe you still can't).

However, after I built this little mini-app, because of a very useful side effect, I saw its one tiny web page every single day, several times a day, and in the process developed a very detailed intuitive feel for the volatility of Bitcoin prices. And then, when I sold my Bitcoin, I just happened to do it very close to the peak of the latest bubble. Coincidence?
Here's how the side effect happened. At the time I wrote btcusd.gilesb.com, Safari was my only web browser on my iOS devices, and iOS Safari has a number of very poorly-conceived quirks, the worst being that any time you open it on an iPhone, it will idiotically jump to your Bookmarks, as if bookmarks were a feature which normal people ever even use. I began developing muscle memory for the task of closing the bookmarks and switching to the search field, but it struck me what a terrible maladaptation that was, so I decided to do something else instead.
I developed a simple habit for my iPhone of always keeping a web page open which had a simple DOM and a very fast page-loading time. (DOM simplicity can be more important than actual network loading speed when it comes to perceived performance.) I chose Hacker Newspaper for this purpose.
Hacker Newspaper is a miniapp like btcusd.gilesb.com, but for Hacker News, which I had written a few years earlier. I wrote it because Hacker News makes (in my opinion) terrible and obvious mistakes in typography, color theory, and web application performance, as well as terrible but subtle mistakes in application design. Anyway, Hacker Newspaper loads very quickly and renders very quickly, because it features a simple DOM, and very few external assets, so it got me around the usability fail in iPhone Safari. But btcusd.gilesb.com loads and renders even more quickly, with an extremely simple DOM, zero external assets, and also zero distracting links, so I made that my default launch page for Safari on the iPhone instead.
That was in 2011. It's 2013. I've seen the Bitcoin price fluctuating nearly every day since then, sometimes very many times per day. I've never given it a lot of attention, but I didn't have to. I've developed an enormous amount of context for Bitcoin prices as a side effect. (This is why I firmly believe you have to be judicious about what information you consume, both actively and passively.)
Anyway, my massive profit percentage is in fact just a tiny sliver of actual dollars. However, what I plan to do is continue using btcusd.gilesb.com this way, and buy BTC again when I feel they've hit a low. I'm willing to trust my intuition in this regard because I've developed it against a lot of data. Although this is just intuition, I expect the price to dip quite a bit at some point in the future, and I have very logical reasons to expect that I'll be among the first to know if/when that happens. Having tested this system with a small amount of money, I'm willing to experiment with a larger amount next time.
Of course this is not financial advice, and although I think some sane solution for Bitcoin and taxes will emerge, this is not legal advice either. But it is programming advice. You should shell-script the web. Hacker News annoyed me, so I fixed it with a tiny mini-app, really not much more than a shell script. Google didn't extend its automatic currency conversion to BTC, so I fixed that with a tiny mini-app too, again not much more than a shell script. And then I used that shell script mini-app to avoid Apple UX fail, and made an absurd profit percentage as a side effect.
Shell script all the things. The web is full of broken. Fixing even the little problems can accidentally net you huge profits.
Saturday, April 6, 2013
Subscribe to:
Posts (Atom)













