Archive for the 'tech' Category

Mac OSX – tabbing in forms and skipping select controls.

August 12, 2010

The fact that when I tab through a form on my Mac, it skips the drop downs, which forces me to use the mouse, has been bugging me for a long time.  I finally decided to try searching google for an answer and came upon this old, but still very relevant post by Tony Spencer:

http://www.tonyspencer.com/2006/05/02/tab-skips-select-form-fields-in-mac-browsers/

Awesome.  The only difference between 2006 and now (Snow Leopard) is that in System Preferences, Keyboard and Mouse have been split into two separate menus, so you should go System Preferences >> Keyboard >> Keyboard Shortcuts to find the ‘All controls’ radio button.

JSLint’s ‘unexpected end of line’ vs. JQuery style

June 10, 2010

I recently added a script to run JSLint over any javascript files that were changed in my last batch of commits when I push changes to our main repository (if you’re interested, you can take a look).  Immediately, I had my feelings hurt when it started reporting a bunch of errors and warnings.

Most of them I agreed with, but the ambiguous end of line warning when the line was catching syntax that I had very purposefully used to increase readability (for me).  Read the rest of this entry »

mysql_connect and ‘No such file or directory’

June 2, 2010

I was working with a friend to get him started with PHP development on OSX, and we were stumped by a ‘No suck file or directory’ error message for a long time.  It seemed to be coming from the following line:

$this->linkid = @mysql_pconnect($host, $user, $password) or die(mysql_error());

At first, we didn’t understand it, because it doesn’t look like PHP is trying to connect to a file there.  However, we eventually discovered that the file that wasn’t found was the MySQL socket.  Because he had used Ports to install MySQL instead of downloading the .dmg from mysql.com, he didn’t have the same default socket as most other people on the internet. Read the rest of this entry »

Difference with sed in-place editing on Mac OS X vs. Linux

May 27, 2010

I ran into this problem about a month ago with a bash script that I was writing on my MacBook Pro.  For some reason, in place editing with ‘sed -i’ just wouldn’t work, no matter what I did, and I couldn’t find any solution online.

When running something like

sed -i 's/before/after/' test.txt

you get the error message sed: 1: "test.txt": undefined label 'est.txt'.

Eventually, it turned out to be because sed’s ‘-i’ option takes a parameter to indicate what extension to add to the file name when making a backup.  For example,

sed -i '.bak' 's/before/after/' test.txt

leaves you with two files, ‘test.txt’ and ‘test.txt.bak’, where ‘test.txt.bak’ is the original version.  Unlike Ubuntu and other linux versions, on OS X, this extension parameter is required.  If you really know what you’re doing and don’t want a backup made, you need to provide an empty string ”.

The correct way to run this command on OSX is

sed -i '' 's/before/after/' test.txt.

How to include git hooks in a repository AND still personalize your machine

April 6, 2010

In my new job as Director of Engineering at 25Lux.com, I’ve been dealing with a lot of the infrastructure parts of development that I mostly glossed over before because I always worked at a company that had everything set up for me.  It’s a good chance to think about in what kind of environment I’d really like to develop.

It turns out that big part of my answer involves automating everything.  Part of my reasoning is that our team is very small now, so the more we automate, the more we can concentrate on just development.  Another part of my reasoning is that I’ve read a lot about continuous deployment lately and many of the principles like decreasing the time between developing a hypothesis and learning your answer make sense and can only be achieved through extensive automation. Read the rest of this entry »

Staying Connected Overseas with Google Voice and Skype

March 11, 2010

When I first moved to China, I decided that I still wanted to stay connected to the US.  Part of that is keeping a US phone number that can both send and receive calls and text messages.  Luckily, thanks to products like Google Voice and Skype, doing so is now cheap and easy.
Read the rest of this entry »

Root access on Ubuntu server?

November 1, 2009

I’m in the process of setting up my very first production server using Ubuntu, and I’ve ended up spending a lot of time reading about security online.  Since I’ve always let the ops team worry about setting up environments, etc., I’ve now learned that there are a lot of different concerns to think about.

One decision in particular is bugging me right now – how to secure the root account on my new machine?  Read the rest of this entry »

iPhone Reference Errors

February 28, 2009

I’ve decided to give iPhone development a try.  I have a few ideas for cool mobile apps that I’d love to implement so that I can learn a new platform, a new language, and maybe make some money on the side…  However, I’ve remembered what I dislike most about programming – configuration.

Read the rest of this entry »

Free Speeches Online

February 24, 2008

I just learned about this cool website: www.ted.com.  TED is an organization that asks famous/interesting people to give 20-minute speeches and records them.  Now, on their website, you can watch speeches that they’ve collected over the last 24 years.  A lot of this content is probably available on YouTube, but the signal-to-noise ratio is much higher on TED because of the limited format and the high barrier to entry.

This morning, I watched a talk by J.J. Abrams, and yesterday I watched a theramin concert and a speech on aging by Aubrey de Grey (whom I’ve read about, but had never seen before).  If you have twenty minutes to spare, you should check it out.

Dancing for Engineers

January 6, 2008

Now here’s a topic I’ve been thinking about for a while. I started going to salsa dancing lessons fairly regularly this fall, but am having a hard time remembering the long sequences of complex moves that I learn in the MIT lessons (which are great, by the way). Even when I can remember them, it’s hard to do them on the dance floor with a girl who doesn’t also know what is coming, while staying on the beat, etc. etc. So, at some point this fall, I thought to myself that there must be a better way to learn enough sequences of moves not to bore a good follower to tears. Read the rest of this entry »