Ignored By Dinosaurs 🦕

Does anybody here want to build something? My buddy Jimmy of This Blog fame laid an idea on me the other night. He's a teacher, and a fairly progressive, observant one at that. I believe him when he says that there's nothing out there like this kinda simple, cool idea that he had. I think it must exist somewhere but it's not being properly promoted if it does. So, I thought maybe it'd be a cool idea to try and teach him a little something about web development, and teach myself a lot in the process. There's no way that this idea of his is currently within my grasp since a big part of the concept is an iOS app, but I don't think the overall idea is really that far outside the realm of possibility. It's going to need a web backend to it, anyway. So let's see. Where to start?

I think we'll build it in Rails since I've learned enough about programming to know that I prefer Ruby as a language to PHP. I think this idea could easily be done in Drupal (a large, flexible content management system that's built in PHP) as well, but for some reason the aesthetic of building the solution you need and no more is really appealing to me. Drupal takes care of a LOT of the stuff that we're going to need to do upfront, things like user authentication (accounts) and interacting with a variety of different protocols – essential if the app phase is ever going to work. Drupal and Rails are both just pieces of software that run databases for you, but the difference is sorta like the difference between buying a really good loaf of bread and baking a really good loaf of bread. It doesn't make you any less of a chef to serve the store bought loaf to your guests, but if you have the time and you know how to bake a good loaf (or if it's just something you want to get good at), you're going to prefer that route.

Step one is getting Rails installed on your computer which, if you bought a Mac is made significantly easier. We'll do that next.

#generaldevelopment

Welcome back to another installment of the newby web developer series. This morning's entry comes once again from our buddy Jimmy, who the two of you reading might know as the highly technically inclined CT robo-teacher. He'll probably be reforming the state of education in your state soon.

What's up fool.

My friend wants me to build him a simple site using wordpress. He already owns the domain name.

My question is, once I build the site using MAMP, and get everything upload to our host, how does the domain name get transferred? Is that something we have to handle or the host handles.

Thanks, Jimmy

Calling me a fool is his way of showing affection. So, the answer is that “it depends”. If your buddy went the “get your domain free with a year's webhosting” route that many larger webhosts encourage you to do, then you don't have to do anything. If your buddy bought the domain on the open market through a registrar such as GoDaddy, you have to dive into the scary, subterranean world of DNS.

DNS stands for Domain Name System. A perhaps less-than-100%-accurate description —

When you buy a domain name, it's sort of like buying a spot in the world's internet phone book. That is to say that the address http://johnnygrubb.com is actually an “abstraction” of the information that a computer needs to complete your browser's request to get my webpage to come up. What my computer needs to know is the IP address of the server where http://johnnygrubb.com lives. The Domain Name System does that for you.

If you need to look up the phone number of Newtown Chinese Restaurant in Newton, you go to the phone book, look for Newtown Chinese Restaurant and move your eye to the right to get the phone number. If you want to go to any website, you enter the address in your browser, which takes the request and hits the nearest DNS server to find the actual IP address of the webhost so the requested page can be grabbed. It's the job of the owner of the domain name to make sure that the “phone number” or IP address is correct.

If you've bought your domain name as part of a package, then you don't need to do anything. The webhost actually owns the domain name and is letting you use it. This has pros and cons obviously, the pros being that they handle all of this DNS stuff for you.

If you've bought the domain name separately, you need to give that name a “phone number” so that DNS knows who to call when you request a page from that site. That's done by getting deep into your Domain Control Panel (or something like depending on the registrar) and and finding the “Nameserver” controls. This is where you give your domain name an address. It's usually in an english readable form, for instance, one of the nameservers for my hosting account is ns1.mediatemple.com. That means that when a request is made for a page on this site, DNS says “don't look at me, go talk to Media Temple's nameservers. They know where to find that page.” Once the request gets to Media Temple, their nameservers say “the page you seek is at 64.207.129.18”, which is the IP address of the actual server on which this site is plopped.

So, to extend the analogy a little further, a DNS lookup is actually more like that movie where the kids are trying to find the super-cool party, only to get to the party they have to drive all over town from one destination to the next before they are finally given the actual address. For real fun, type this is your Terminal —

traceroute http://ignoredbydinosaurs.com This command will show you all of the different “nodes” out there on the web that your request hits before it actually arrives at it's destination, my webhost.

So, the tl;dr is that if he bought the domain name through a webhost as part of a hosting package, you don't need to do anything. If he bought the domain name on it's own, you need to go to the Domain Control Panel or the Domain Manager or whatever it's called where it was registered. In there somewhere is a setting for the nameservers. On the webhost's end, you'll find what their nameservers are (usually something like ns1.awesomewebhost.com and ns2.awesomewebhost.com) and put that information into the proper fields on the registrar end. There's always at least 2 nameservers at every host because like all servers, they can go down and if they both go down your site will be unavailable. It happens.

Changing nameserver information is like firing an MX missile. There is no “undo”. There is no recalling the missile. Once you push the button to change the nameservers, that change of address starts filtering out to the rest of the world's DNS servers so that the request can be sent to the proper IP address. This filtering-out process can take anywhere from a few hours to a few days, depending. Once it's done, the whole world will be pointed to the party on your server.

#generaldevelopment

My vet just recently joined the 21st century and moved all of their records from big, brown paper files to a computer system. Her husband is an IT guy so he did the research and picked out all the computers, networked them together and set up this software system for the office. It looked like a pretty big job to migrate all of their client records to a computer system, but hey, the avoided it long enough, right?

I don't know why I just thought of this, but about a web app that manages all of that stuff? Clients, their pets, their pets' histories, etc. Then I thought, well, that's kinda ballsy for a vet's office to let a web service store data like that, and what if you want to move, etc. Well, okay, how about some kind of export API etc. Then I thought, well what about hosting the database at the client end...

Would this be a case for something like CouchDB or MongoDB? A local datastore, and I would provide the processing and the upkeep? I dunno. I'm gonna sleep on it. Sounds like a fun little project in any case...

#random

I am having a blast. I found a nice photo gallery Gen Next – has lots of cool features; still working on it.

I do need some help:

1) how do I keep the 'home' page of the WP site clear of posts? I just want to put some html text and links. It seems to always show the latest posts. I need to understand what is going on with that page.

2) How can I order the posts within a category. example: For Lyrics I have category per album with a post for each song. I need to order them in track order, it seems to always put the newest post first. Ordering by permalink would work since I put the track number as the 1st part of the name.

3) Gotta turn off the right nav stuff – not needed.

I tried creating a category called Lyrics and then adding sub-categories for each album. That created the Lyrics page with all songs listed, I wanted just links to the sub-categories; plus it made the menu real ugly with all the albums listed below main menu. I resolved this by making Lyrics a page and putting links to the 'album' categories in the html. It seems to work fine but I am not sure if I could have done this another way.

also: where do I comment out the 'add comments' stuff?

Alright, in order —

  1. Go to Settings –> Reading and set the top option to display a static page as the home page. You'll have a list of options for which static page you want.
  2. As with almost any programming challenge, there are a couple of ways to go about it. I'm not exactly sure how you want them to display in every situation, but I'll take a beginning guess.
    1. The easiest, and in this case probably best way to go is to just make sure you enter the lyrics for the songs in the reverse order than how you want them to appear. If you've already entered some of them in, you can alter the “published date” on the edit screen of each lyric page. I'd just edit that have them line up in the order that you want.
    2. The more stylish option would be to write a function in your theme's functions.php file. To make this work correctly you'd have to make use of the “custom fields” feature. I'm a tiny bit rusty on the exact way to go about this, but basically “custom fields” are extra bits of metadata that you can add to any page or post in WP. For instance, you could create one custom field with a key called “track number” and use the value of that field to define the track number. You'd then figure out the correct function to call with the correct arguments to make it show up in the right order when someone came to the lyrics section of the site.
    3. Doing the same thing from the theme template would also be an option, and probably a little more realistic since you'd be able to have the correct template called by following the naming convention for a given category. This page will tell you how.
    4. Slightly off-topic, but there's also the option of creating a blanket “Lyrics” category, and then creating a post for each album that simply lists the songs in the running order, and then links the song titles to another post that contains the lyrics for that song. This option might give you the most control for the least effort.
  3. So you don't need a right sidebar at all?
  4. Right, yeah I would ditch the sub-categories for the albums, and probably go with option 4 above.
  5. If you look at line 29 on the page.php file and line 39 on the single.php file, you'll see the comment function. I'd just comment it out so it reads -

<?php //comments_template( '', true ); ?>

and your comments will be gone.

#generaldevelopment

This one is for my buddy, Bob. Bob is an old school developer who has recently been baptized by the cooling waters of the web. He's building a site in Wordpress, so I thought I'd post a few relevant pieces of info up here for him, and those of his ilk.

First of all, realize that Posts and Pages are almost the exact same thing. The key difference between the two as far as I can tell is not that Pages are easier to add to the top-level navigation, but that Posts allow you to classify them with “Categories”. This allows Wordpress to work it's relational database magic, and in the hands of a skilled template author you can really take a very simple system and make it produce just about any listing of content that you want. When in the early stages of developing a site, it's better to take what you'd think of as top-level content items and see if there's any way that you can make it a listing of Posts in a certain Category, rather than just dumping related info on one Page. The chief advantages of working this way are maintenance and search-ability.

The Wordpress Codex is a wonderfully organized place to learn a lot about authoring templates. Most of the Wordpress core is basically just a large group of functions for talking to a database, and much of the magic of pulling the info back out in the way that you want it is in the template layer. Thus, the Theme Development section of the Codex is the place to spend a couple of days getting used to the way Wordpress works.

I'd suggest downloading my very bare bones base theme and stepping through some of the template files while browsing the Template Tags function reference. It may not make sense immediately, but it won't take long.

So I've been doing a lot of CMS work lately, both Drupal and Wordpress. The Wordpress gigs seem to come and go within a week, and are mostly just banging together a theme with varying amounts of complexity. I'm a recent convert to the 960.gs CSS framework, which makes the absolute quickest work of laying out a website. It's a thing of beauty and I've actually created my own base theme to make the work even quicker, but that's for another post.

Every one of these gigs requires the exact same setup – downloading various bits of software from all over the internet and copying them to specific places on my hard drive and then wiring them all together. It's a time consuming and utterly repetitive process, which makes it perfect for a computer to do. Even more perfect is that I'm already on a computer when I'm doing it! Wow...

I'd already taken to doing much of this work from the “command line”, and it only occurred to me yesterday that if I were doing the exact same series of commands from the command line every time I set one of these things up, isn't that something I could write a “script” to do for me? For those of you – a “script” is exactly what it sounds like. In the most basic sense all computer programs are scripts, be they compiled scripts or interpreted scripts. You must tell the computer what to do in no uncertain terms at all times for all possible scenarios. Failure to do so is a Bad Thing. So in this sense, I'm writing a series of terminal commands in the same order every time. I had no idea until yesterday that it was as simple as saving those commands into a file and running that file to get what I want done.

So, about 20-30 minutes worth of downloading, copying, and renaming has been reduced to about 20-30 seconds, depending on bandwidth. Here's the script, in case you're curious —

#!/bin/sh

wget http://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
rm latest.tar.gz
echo "Name of directory?"
read directory
mv wordpress $directory
cd $directory/wp-content/themes
wget http://github.com/JGrubb/Base-WP-theme/tarball/master
tar xzvf JGrubb-Base-WP-theme-0efd724.tar.gz
rm JGrubb-Base-WP-theme-0efd724.tar.gz
mv JGrubb-Base-WP-theme-0efd724 ibd

Now I'm off to write a script to do the same thing for me for Drupal...

Well, the hardest thing about blogging is not having things to say, but finding the time to write them down. And oddly, when I do find the time to write them down, I have very little to say. This is no exception...

There's a blogger out there named Anil Dash, who I first stumbled across at the Gathering by the River over there in Yarmony Creek territory. His bio is on the site, but he worked for Six Apart, a company that made some of the first mass-used blogging software. Their main platform is/was called Movable Type. Moveable Type powers Daring Fireball, I believe, and has mostly had it's lunch eaten by Wordpress. Six Apart has recently been bought by some larger company, and that's not what this post is about so I'll skip the details.

Six Apart was one of the few venture capital funded software companies to have been birthed in the wake of the Clinton era technology bubble (or the bursting of said bubble, to be more accurate). The founding of the company is profiled in the excellent book Founders at Work, one of the few cover-to-cover-interesting business books I've ever read, and the only one on the Apress imprint. I highly recommend it to anyone who's interested in how some of these more modern web startups got their start, as well as some interesting backstory on Apple, Adobe, and a bunch more early 80's innovators that you've probably never heard of. There's a section on Evan Williams, one of the really smart founders of Twitter, only the profile was written about three years ago, when he was known as one of the really smart founders of Blogger. Rather amazing.

And cue the crying baby.

Anyway, my point was that Anil's blog has seen a lot more interesting action lately, which is cool because he's got some really interesting takes on some of the business out there and the culture that goes with it. Enjoy.

jg

And I'm not talking about the iPad. The iPad is so cool I still haven't had the opportunity to play with one yet, but from a hundred miles up it's still just one of the bazillion devices that fall into the terrifically broad and jam-packed category of “gadgets to read stuff on the internet”. “Consume content” is the hipster way of saying it. It's an obviously lucrative market, which is why it gets the attention of so many innovators. Well and good, but what about people who “produce content”, we'll call them writers and publishers from now on...

I finally experimented today with a service that I signed up for several months ago but never spent the 45 minutes to learn how to get it going. It's called Typekit. The idea is so simple and so brilliant. Allow me...

[!info] <geek content <!--feel free to skip ahead--> >

There's a fundamental issue when you're building a website that most people probably aren't aware of at all. The issue is the limited number of fonts that you can reliably use to set the type on said website. The vast majority of the world is browsing your site on a Windows computer with a standard set of fonts installed on it. Yes, fonts are installed on your computer. It's a weird concept. When you browse to a website, that website tells your browser what font it would prefer to have used when the browser shows you that webpage. It's not at all uncommon for the designer to want to use a font that's not installed on that computer. There are only about a dozen or so “web-safe fonts” that you can rely on, and it gets old really fast using those same fonts over and over and over. If the designer wants to work outside that box a little he may ask the browser to call a more exotic font, but he'll also specify what he wants used if that font doesn't exist on the user's computer. Confused yet? An example perhaps...

This is a sentence set in Arial.

This is a sentence set in Lucida Grande

This is a sentence set in Georgia

This is a sentence set in Courier New

That's all cool, but what if you want to use something more exotic to give the name of the site a bit more branded flair? Well, in the case of Twitter and most every other website on Earth that means firing up Photoshop and making it there. You get many more fonts to choose from and you can always make your own if you want. Photoshop then spits out your cool text as an image. Yes, that Twitter logo is an image, not HTML text. That means that every browser renders it just like you want it, but it also means that it's a relative pain to change and that search engines can't tell what it says unless you fill in a bunch of info about it. HTML is preferable for anything that's meant to be read, but then you only get those dozen fonts. Double rainbow of a bummer.

So Typekit has a service that lets you use a whole bunch of different fonts, served up to every browser that's reasonably modern. I won't bore you with the details (that's for another post), but it's a serious lifesaver. I'm working on a site right now and my favorite Myriad Pro just ain't doin' it for the site header when it's set 3 inches tall. For a variety of reasons I didn't want to go to Photoshop, so I dove in and tried out Typekit. I soon came upon a cool font called Cody something or other.

Not exactly what the designer used, but vastly more stylish than Myriad.

</geek content>

Now, here's why this is cool for all of us. Services like this are actually starting to focus on the “production” end of the content business. That's a very good thing for all of us. That means that the web is finally hitting puberty as a publishing medium. There's a reason that there are a million different fonts in the world, because an all Courier world would be very boring indeed. It's a terrible thing that most websites only get a choice of a dozen different fonts, but it's a wonderful thing that someone is putting their head toward solving this problem for us all. I personally think that this is a BIG market waiting to happen. Get in now.

Speaking of BIG markets waiting to happen, has anyone tried out Greplin yet?

I think Fred Wilson sums it up pretty well.

So now we have a situation where the access providers want to change the game. And they are seeking the regulatory approval to do just that.

Venture backed startups and venture capitalists don't use regulations and lobbying as competitive advantages. We don't have armies of lobbyists. We don't have congress on our payroll. But the access providers certainly do. They have been regulated for a long time. They know how the game is played and they use it to their advantage. Regulation is their game. They want our government to regulate the Internet and they want those regulations written in a way that allows them to do what they want to do. A regulated Internet is a comforting thought to the access providers and a frightening thought to entrepreneurs and the ecosystem around them. [...] There is a lot of debate and discussion going on in Washington, Silicon Valley, New York City, and all around the country right now about net neutrality and regulating the Internet. We have big companies with huge vested interests making proposals that are heavyweight and are not startup friendly. We don't need Google, Verizon, AT&T, or anyone else telling us how to regulate the Internet. We don't need pages and pages of rules written by lawyers that will employ lawyers for years to come.

We just need to choose not to discriminate on the web and thereby maintain the way the Internet works today. I hope that everyone will come to their senses and realize that is the simplest, easiest, and best path forward.

Make no mistake. If this happens it will be a very bad thing for America.

Via AVC.

I was just thinking about iTunes this morning as I was downloading the new Big Boi record. iTunes is the only option to download music on my iPhone. I'd rather download music from Amazon mostly because they offer their catalog in mp3 rather than AAC format, because their albums tend to be a dollar cheaper, but mostly I think Apple could use some competition.

Amazon has the MOST outstanding iPhone app I've ever seen. It's not quite as easy as the website for doing heavy research, but only because of the size of the screen. I actually think the interface is better on the iPhone app. All the information you need is right there, and it's as intuitively laid out as it could possibly be. You can track your order, the search is fantastic and all of the product reviews are right there. Unfortunately, due to the rules in the iPhone SDK and the restrictions that Apple places on iPhone developers, you can't download music from Amazon to your iPhone. There's nothing preventing this feature from a technical standpoint, though Apple would argue that outside developers might write crappy software that would degrade the performance of blah blah blah. I don't think Amazon writes crappy software. The only real reason is to prevent competition.

iTunes is the “largest seller of music on the planet”. I'm not in the mood to do any research on the market share of the iPod and the iPhone in terms of smartphones and mp3 players, but it's obviously substantial. In terms of mobile delivery of digital music, it's a virtual monopoly.

If/when the DOJ (or more likely the EU) starts making noise about opening anti-trust charges against Apple to force it open it's platform up a little bit, I'll be cheering them on.