Archive for the ‘Web’ Category

Now in Helvetica Neue Light

Tuesday, October 6th, 2009

Articles and links in the sidebar have been upgraded to my official favourite font, Helvetica Neue Light. It’s pretty easy to do, but hard to figure out on your own. After searching for a while and experimenting on my own, I came up with the following CSS.

font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;

Some browsers (IE + the older ones) use fonts based on their family name and their style, that is “Helvetica Neue Light”. Others use the PostScript name, under the Adobe spec, e.g. “HelveticaNeue-Light”. Others still, such as the latest versions of Safari, Firefox, and Chrome, conform to the W3C specification when it comes to fonts and their styles, and take only the Family Name. The W3C dictates that you must use other CSS directives to get “light” or “bold” fonts. In this case the “Helvetica Neue”, along with the “font-weight: 300;”, will display Helvetica Neue Light to the user.

Arial is included for the sake of the poor Windows users out there, who have to use the font Microsoft put on their computer because they were to cheap to pay for Helvetica, despite it being one of the oldest and most widely used fonts in the world. As any typography nerd would know, Arial was a total rip off of Helvetica and should never be used.

There you have it. MacĀ users get to look at Helvetica Neue Light, while Windows users still get crappy old Arial.

How to get your very own two-letter domain

Monday, October 5th, 2009

I’m sure most of you internet people have heard of the various URL shortening sites out there in the wild. They’re used to make a long and scary URL (which stands for Uniform Resource Locator) into one much more timid and digestible. Blah blah blah. The point is, you may have noticed that all the good ones (tinyurl.com is ugly and commercial and gross, bit.ly is an exception) have a domain that is only two letters long, like tr.im. Now how do they do it?

Most big hosting companies and domain registrars will not only tell you a domain any less than three letters is invalid, but they probably won’t support whichever obscure ccTLD (Country Code Top Level Domain, e.g. .ca for Canada) you feel like owning. There’s no real reason for this, other than that most companies are stupid and don’t know what the hell they’re doing. Especially when it comes to technological stuff like this; the CEO of GoDaddy probably doesn’t have more than a vague idea about how the internet really works. Oh well, more power to the people.

And by “the people” I mean the people at iwantmyname.com. Not only is their service great, with a nice clean interface and a whole six pages of TLDs to choose from, but they accept ANY valid domain, including those with only two characters at the second level.

Screen shot 2009-10-05 at 10.18.08 PM

It’s a great service, and I’ve used them to buy all two of my two letter domains. I even started a little URL shortening service of my own, called zi.gs, just for fun. I took it down a while ago after it became boring and tiresome to provide support for.

Anyways, there you have it. Easy two character domains, supporting lots and lots of TLDs.

The public beta of Wikipedia’s new interface announced

Thursday, September 17th, 2009

Ahh, that’s why. The reason Wikipedia has been acting like 4chan on a bad day is that they were upgrading their software, and now we know exactly what part was upgraded.

Pretty!

Pretty!

They added a little link at the top of the page entitled “Try Beta”. If you click on it, and log in, you’ll be able to switch your current interface for a brand spanking new look n’ feel. It looks nice, but I’m not sure whether I’m happy about sacrificing the speed and simplicity of the current design just for a few whistles and shiny menu bars.

Edit: Apparently the wonkiness was actually related to something else. The new look is still pretty cool though.

Wikipedia’s error page, if you ever wondered

Thursday, September 17th, 2009

Has anyone ever seen this before? Today when I visited it there was a message in the header saying they were updated their software and might experience some down time. But in the middle of the day? I guess it all depends on your time zone (EST here), and the point of Wikipedia is to be as neutral as possible. In any case, it was interesting to see.

 

Wikipedia Error Page

Technically it's Wikimedia, but still.

 

ACLr8 site redesign

Sunday, September 13th, 2009

It’s not much, but the ACLr8 site has been changed a bit. I added MacUpdate and stuff. Also, quite an accomplishment for me, I’ve finally managed to make a page have a minimum page length but no maximum. That is, if your screen is smaller than the content, you’ll get a scroll bar. But if it is larger, the page continues until the bottom of the user’s screen. Go to the ACLr8 page and press Cmd/Ctrl and Minus (-) to see what I mean. Really it’s just two divs, set with absolute position on top of each other. One contains the content (haha) and has no set height, and the other has a height of 100%, but is just an empty background. Simple, really. I just never had the idea until today.

I also got a nice email from Softpedia telling me they’ve added ACLr8 to their database, and that they’ve deemed it “100% clean” and all that. It was nice to hear. ‘Cause I was pretty sure I put a virus in there somewhere.

Softpedia 100% Clean

ZI.GS is no more

Saturday, August 29th, 2009

The not-so-legendary URL shortener has been a fun development project, and I’ve learned a lot from it’s creation. However, after reading about it in approximately seven different places, I have decided that URL shorteners aren’t good for the internet as a whole, and that I no longer support their use. They have only one legitimate use really, and that is Twitter. And for Twitter, there are a hundred shorteners out there already with way better interfaces, reliability, and support.

ZI.GS, requiescat in pace.

How to avoid looping in mod_rewrite redirection

Tuesday, June 30th, 2009

When redirecting things to a new location that fits the original rewrite pattern, you end up with a recursive feedback loop and all you get is an error. If you specified a URL scheme and a domain in your rewrite (meaning that the redirection is visible to the browser) you’ll see the error in your browser saying something along the lines of “the page tried to redirect too many times”. Otherwise, the redirection will be internal, and you’ll get your server’s 500 Internal Server Error page.

redirect_loop_safari

So, how do you avoid it? Well, say you wanted to redirect some regex (regular expression) pattern to the your index page, say index.php, but it turns out that “index.php” actually matches your pattern, so index.php redirects to index.php which redirects to index.php, and so on, and so forth.

To prevent this, simply add a RewriteCond that checks the REQUEST_URI to make sure it doesn’t match the string that you redirect to. The following is an example.

RewriteCond %{REQUEST_URI} !^/?index.php$
RewriteRule ^(regex|goes|here)$ /index.php

Just make sure the regex in the first part does not match any of the pages you want to redirect, and that’s it! You’re done.

Best of luck on getting this to work the way you want it to, and happy web developing!

A subdomain for each directory with .htaccess and some mod_rewrite wizardry

Wednesday, June 10th, 2009

I don’t know how useful this will be to anyone, but I was playing around with my webserver a while back and because subdomains are pretty cool I thought I would figure out for myself how to do this.

You may use either httpd.conf or an .htaccess at your document root.

Make sure you have mod_rewrite turned on before you begin.
RewriteEngine On

First, use a RewriteCond like this to prevent redirection things like your favicon.ico that need to be available everywhere. Change this based on your setup.
RewriteCond %{REQUEST_URI} !^/(favicon.ico|images/.+|javascript/.*)$

Then, capture the subdomain in %1.
RewriteCond %{HTTP_HOST} ^(.+)\..+\..+$
This next line just prevents looping by making sure the REQUEST_URI doesn’t match the what’s in %1. Don’t ask how it works.
RewriteCond %1,%{REQUEST_URI} !(^[^,]+),/\1.*

This checks to see if what we have in %1 is in fact a directory under the document root.
RewriteCond /your/document/root/%1 -d

And finally, redirect ‘/anything’ to ‘/subdomain/anything’.
RewriteRule ^(.*)$ /%1/$1 [L]

And there we go, that should do it. All together, that’s:
RewriteCond %{REQUEST_URI} !^/(favicon.ico|images/.+|javascript/.*)$
RewriteCond %{HTTP_HOST} ^(.+)\..+\..+$
RewriteCond %1,%{REQUEST_URI} !(^[^,]+),/\1.*
RewriteCond /your/document/root/%1 -d
RewriteRule ^(.*)$ /%1/$1 [L]

Questions, comments, criticism, and other feedback are very welcome. If you have a better way of doing it, let me know!