Recent Posts
A Truly Minimum Viable Kitchen
published 2014-02-24
I read Matt Maroon's Minimum Viable Kitchen post (and the ensuing Hacker News discussion) a while ago, and I've been thinking about it off and on since then.
Not about the post per-se, but about what a minimum viable kitchen was, and whether there was anything interesting in the concept.
In the original post, Matt goes into great detail on a huge list of things that are needed for a Minimum Viable Kitchen. It quickly becomes obvious that Matt is not a minimalist. The list includes things like a stand mixer, a scale, and a 10-piece pot and pan set. Nothing wrong with that. I own a stand mixer and a scale, and I use them all the time, but I certainly wouldn't put them on my "desert-island kitchen list". I don't own 10 pots and pans. I do agree that you need good quality ones, but 10 seems like a bit much, even for a non-minimal kitchen. I'd rather have the extra cupboard space.
Truly Minimal
So, let's scale it back a bit. What is a truly minimalist kitchen, and what can you make with it?
I'm going to assume that you are living in a standard house that comes with a fridge, stove and oven. Let's pretend you are just moving into your first place and have nothing else. What do you need to cook with? I'm going to ignore anything you use to eat, we're just talking about getting food to the table here.
Okay how's this for a first shot.
Read MoreNo Excuses
published 2012-04-23
I wrote this in response to a post on HN. I could link to the post, but it doesn't matter. There are posts like this all the time. Stop making excuses. Go build something.
Read MoreThis is going to sound more dramatic than it was, but here's one way of summarizing the last five years of my life:
I was 35, working at a great job as a physicist. Amazing team (I was usually the dumbest guy in the room), amazing project, but I was bored. I knew that if this didn't make me happy, I needed to get out. I read a few PG essays, caught the startup bug, and started coding in the evenings.
Within 8 months, with a brand-new daughter and another that was two, I was gone from that job, working on my own. In that 8 months I had taught myself web-dev from scratch.
I knew nothing of Ruby, HTML, CSS or JavaScript. I had a smattering of Unix knowledge and had been coding data-analysis in Python and C for a while, but the amount I had to learn was staggering. I bought tons of books, learned tons, and (luckily) had no idea how much I still had to learn.
Getting up and running with Amber
published 2011-12-08
I was quite excited by Yehuda Katz' [announcement of Amber.js][announcement] this morning. I had been intrigued by SproutCore, but hadn't really liked how big it felt. So, when Yehuda said "If you played with SproutCore and liked the concepts but felt like it was too heavy, give Amber a try", I listened.
The following is mostly just notes of what I learned. It's not at all complete, but it should get you up and running and get you something to play with quickly.
Getting it on your machine
Assuming that you have git, Ruby 1.9.2 and a recent version of bundler installed, this is pretty straightforward. So, use rvm use 1.9.2 or the rbenv equivalent if you need to. These commands should do it:
git clone https://github.com/amberjs/amber.js.git cd amber.js bundle install rake dist
This will create sproutcore.js and sproutcore.min.js in the dist directory.
Creating Hello World
Now that we've got the Javascript files, we can make a new project skeleton for a hello world app. We want to end up with an helloworld.html file where we put our HTML, and a javascripts directory where we put some JS files to include.
Speeding up Jekyll Generation
published 2011-11-18
One of the only complaints you'll see out there about Jekyll is that when sites get bigger, it starts to slow down.
Luckily, this is easy to fix. Unfortunately, it's apparently not obvious as you still see people complaining about it. Here's my attempt at proselytizing for Jekyll :).
If you run jekyll --help, you'll see that there's a --limit_posts option. If you set this to 1, then you'll only re-generate your most recent post when you save. This is usually exactly what you want. If you're working on a slightly older post, then bump it up to 3 or 4.
Like this:
jekyll --limit_posts 1
I've put this in a rake task
namespace :jekyll do desc "start the jekyll server in auto mode" task :server, :num_posts do |t, args| num_posts = args[:num_posts] cmd = "jekyll --auto --server --pygments" cmd += " --limit_posts #{num_posts}" if num_posts puts "running #{cmd}" exec(cmd) end end
So I can start Jekyll like this:
rake jekyll:server[1]
and only see the current post, and it's blazing fast.
Read MoreOpening up ports to your security group on EC2
published 2011-11-18
Say you have a cluster of EC2 instances that you want to be able to talk to each other, but you don't want everyone in the world to be able to join in on the conversation. For example, I was just setting up a typical cluster of servers:
- A rails app server
- A DB server
- A daemon server
- A DB slave
I want all of these servers to be able to talk to each other over port 3306 (the MySQL port), but I don't want the whole world to be able to connect over port 3306.
You need two things:
- A security group
- Your EC2 user id.
Assuming you have your ec2 command line tools set up already, here's how you would do it. This will create a group called yoursecuritygroup with ports 22 (ssh), 80 (http) and 443 (https) open to the world, but with all other ports only open to other computers in the same security group.
$> ec2-create-group --description "yoursecuritygroup production" yoursecuritygroup $> ec2-authorize yoursecuritygroup -p 22 $> ec2-authorize yoursecuritygroup -p 80 $> ec2-authorize yoursecuritygroup -p 443 $> ec2-authorize yoursecuritygroup -o yoursecuritygroup -u 1234-1234-1234
You need to add your user id here in place of 1234-1234-1234. You can find this by going to https://aws-portal.amazon.com/gp/aws/developer/account?ie=UTF8&action=access-key and scrolling to the bottom. You want your AWS Account ID.
Now when you spin up your instances, make sure to start them in the yoursecuritygroup group using the --group argument:
ec2-run-instances --key your-key --group yoursecuritygroup --block-device-mapping /dev/sda1=:100:false --instance-initiated-shutdown-behavior stop --disable-api-termination --instance-type m1.small ami-a7f539ce
And you should be all set.
Read MoreMultiple Google Analytics Tracking Codes on one Page
published 2011-11-11
Say I want to make it so that [Leanpub][leanpub] authors can get Google Analytics information about visits to their page while still sending the info to our Leanpub analytics account. This is pretty easy to do, but finding out how took me a bit of googling.
Your google analytics script for a normal, single tracking code looks something like this:
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1234567-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
That's all fine and dandy, but what if you want to have two codes in there?
Turns out it's pretty simple. You add another set of _gaq.push lines, right after the current ones and before (function() {. Something like this:
How big is a Googol, anyway?
published 2011-05-14
A friend of mine told his son that a Googol is a huge number. My kids caught on, so now I hear googol used in conversation all the time.
You know, like this:
I could eat 100 chocolate Easter eggs!
I could eat 1000!
Oh Yeah? Well, I could eat a googol!
A googol is 10100. That's 1, followed by 100 zeroes. It's a ridiculously big number. It's a number purely designed to awe the imagination. It's not really useful in real life.
After hearing googol-bombs dropped all the time like this, you sort of get inured to it. A couple of days ago, though, I started thinking about how big a googol really was. My friend (the same one who brought googol in to my life) and I tried to think of something where googol was a reasonable scale, and came up blank.
Huh.
So, the question I want to ask is: is there anything that has a googol of it in the universe?
Read MoreBooting an Alestic EC2 Image with a Larger Root Disk
published 2011-05-06
I always start up my new EC2 images using Alestic's awesome Ubuntu images.
I typically pick the EBS boot images. My only complaint has been that the EBS size is too small. They're only 8 GB by default.
In the past, the fix has been to follow these directions: start up a server, terminate it, detach the volume, make a snapshot of it, create a new AMI from the snapshot and then start up a new server with that AMI.
Too much work for me.
Today I was starting up another server, and I did a bit of googling and found out that with the latest images, you can just pass in a parameter to your ec2-run-instances command and set the boot disk size to anything you want. Woo hoo!
Here's the google groups thread. Look for the message from Scott Moser.
Here's the command I used to create a new instance with a 100GB boot disk:
ec2-run-instances --key your-ec2-key \ --block-device-mapping /dev/sda1=:100:false \ --instance-initiated-shutdown-behavior stop \ --disable-api-termination --instance-type m1.small ami-06ad526f
The magic part is the --block-device-mapping /dev/sda1=:100:false. This takes three params. The first (which is blank here) allows you to pick a volume to mount as the root. If it's blank, then a new EBS volume will be created.
The second (100) is the size of the boot disk. Change the 100 there to be whatever you want the size of the boot disk to be, in GB.
The third is whether or not to destroy the volume when you kill the instance, and can be either true or false. Unless this is a throwaway instance, you're going to want this to be false.