Need a messenger bag?

Seagull Bags is a small Columbus-based company that makes (what else?) bike messenger bags and accessories. I’ve wanted to get one of their bags for a while, since the satchel that I currently use is designed to carry vinyl records, and can’t easily hold the stuff necessary for a work commute.

Well, this story actually started last year(!). While browsing the Seagull Bags website, noticed that they didn’t have any sort of “preview” feature for ordering their custom bags online. I had been tinkering around with Flash for a few months, so figured I might be able to offer some sort of a trade – “programming a bag preview widget in exchange for a messenger bag” sort of thing. I also already knew Dan McKewen, the owner of Seagull, through church, so I already had an “in.” Well, Dan liked the idea, and I started mucking around, trying to create a Flex app that would be a suitable order form replacement. I actually got pretty far, in spite of my lack of knowledge regarding Flex. What held me up was that I needed some good photos of messenger bags to use in order to create a “preview” of each custom bag. Dan promised me some, but he was always busy, and the project got pushed to the back burner.

Fast forward to July of this year. Out of the blue, Dan said that he had photos for me, and the project lurched from the grave. It had been so long since I’d touched any sort of Flash/Flex, I didn’t want to keep trying to build on what I had previously created. Since my current job had me doing a lot of Javascript and jQuery, I decided to re-build the order form using Javascript. Javascript also had the added bonus of being accessible to Apple’s iOS devices.

There were a few delays (such as me trying to publish my first iOS game and the birth of my daughter), but the form eventually got done! I think it works pretty well, and gives you a decent preview of what you’re getting before you plunk down some of the cold, hard-earned. Check it out at the Seagull Bags site.

UPDATE: They just posted a picture of my bag on Facebook. Awesome!
Mario & Luigi!

No comments · Written by Nathan at 9:53 am · Tags ,


Salty!

So, I am in no way a cryptographer… I read Neal Stephenson’s The Cryptonomicon, but that’s about it. Plus, I don’t really have to do much with password security in web apps… usually securing a directory with .htaccess is as much as I have to do. Sometimes I need to write my own session-based password system, due to some hosts not running Apache. Anyway, for these simple systems, the password is usually stored in plaintext… the system is in place really only to deter, not to prevent attacks. I may change my mind on this if I get screwed by it in the future, but for the present, it’s good enough. However, when creating a system that allows users to make their own accounts, more care needs to be taken. Since people often use the same password in many different areas, obtaining a password in one place can lead to identity theft. So I whipped up this cute little salt generator. Remember, if you are using a salt, you should probably store it so you can validate passwords later. There may be better encryption methods in PHP, but I’m really just scratching the surface right now.

// Encrypt the password with Blowfish and a salt - 16 chars starting with $2$
$salt='$2$';
$salt_length=16;

// Chars to choose from to generate the salt
$chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*";

//Generate the salt string
while(strlen($salt)< $salt_length)
	$salt.=$chars{mt_rand(0,strlen($chars)-1)};

$hashed_password=crypt($password, $salt);

No comments · Written by Nathan at 10:09 am · Tags


Safari 2 = no input tag styles

So I just realized that Safari 2 doesn’t allow text input tags to be styled. What the heck, eh? I was confused for a while, since I had been using the Safari 3 beta on Windows, and it worked there. Then I get the Mac and nothing works to style those stupid tags. With Apple’s “oh yeah, standards, we got ‘em haha suck it IE” attitude, I can’t believe they would leave this in. Standardization of user interface elements aside, all the other browsers do this, so it’s about darn time. My recourse is to say “Sorry!” to the Safari 2 folks. I simply can’t do anything about how crappy forms will look to you.

No comments · Written by Nathan at 9:00 am · Tags


Switchin’ ain’t easy

So, I’ve had my Mac Pro for a while, and am finally starting to get used to it. For a while, though, it was super frustrating to work on; one of the hardest things about switching computing platforms is the minor inconsistencies. For example, in Windows Explorer, hitting ‘return’ will open a selected folder, and ‘F2′ will rename it. In the OS X Finder, ‘Command-O’ opens a folder, and ‘return’ will rename it. Mouse behavior is quite different as well, with OS X using a very non-intuitive mouse acceleration algorithm. I had just gotten used to ‘Home’ and ‘End’ moving my text-editor’s cursor to the beginning and end of a line, but OS X’s default behavior moves the cursor to the beginning/end of the document.

Fortunately for me, it’s relatively easy to edit key mappings in OS X, which means that the functionality I’m used to has mostly returned. For the mouse issue, I had to install a Microsoft mouse driver, which conflicted with the mouse control panel option for a while.

On a somewhat related note, have I mentioned that the Mighty Mouse is horrible? It doesn’t fit my hand at all, has a worthless “scroll wheel” nubbin, and flaky left/right-click support. Sadly, back when I was working at my old job, I had thought about buying one, even going so far as to make some low bids on eBay. I think this piece o’ junk is going up there for some other sod. I do like the Mac keyboard, though (not the new, shallow version). The keys, while not clicky, have an appropriate amount of tactile feedback. The keyboard itself is much narrower than my Model M IBM keyboard, though, which took a bit of time to get used to as well.

All in all, I’m pretty happy about my purchase… a little bit bitter about getting the shaft in terms of RAM and HD space (1 GB/250 GB in a machine of this class? Ridiculous! Plus no Bluetooth or WiFi=superlame), but prices for that stuff will keep going down. I’m glad to be using a more versatile machine, albeit one that’s a massive investment.

1 comment · Written by Nathan at 1:39 pm · Tags


Web dev tips #2

So, this probably doesn’t apply to a lot of folks, but if you’re trying to use tables for page layout (i.e. for HTML emails), you may notice that Firefox inserts blank space at the bottom of each image that you just can’t get rid of. The cause is that the <img> tag has the “display: inline” property, which means that Firefox allows space for “descenders” (i.e. the parts of letters that go below the baseline; examples: jgpq). The solution in table layouts is to assign each image the “display: block” property. Alternately, you can use adjust the “vertical-align” property on the image. Here’s a page with a more detailed look at the problem/solution.

Another thing I just wanted to mention for my own reference was short conditionals in PHP. Example:

<?
	if(empty($_GET['id']))
		echo 'No ID';
	else
		echo 'ID: '.$_GET['id'];
?>

Can be replaced with:

<?=empty($_GET['id'])?'No ID':'ID: '.$_GET['id']?>

The syntax can be broken down into CONDITIONAL ? IF TRUE : IF FALSE

It’s basically just a way to make your code concise and look esoteric while doing so.

No comments · Written by Nathan at 12:01 pm · Tags


← Newer PostsOlder Posts →