Nov 14, 2012 by Matt | Posted in Coding
Mac users with custom entries in their
/etc/hosts files may have noticed that, under Mountain Lion at least, lookup times for local resources are incredibly slow. I routinely set up names that point to virtual hosts on my laptop so I can give projects their own local domain instead of having
http://localhost/projects/something/index.php or somesuch. Typing
something.dev is much easier. I noticed that, since upgrading from Snow Leopard to Mountain Lion, Firefox would spend several seconds trying to look up those names before consulting the hosts file and loading the page.
While I don’t know why it’s happening, exactly, I do have a fix. The wait goes away if you put the local entries on one line.
Instead of having something like this:
You need to have this:
127.0.0.1 myproject.dev wordpress.dev somesuch.dev
Leave the lines that say “localhost” alone, of course. Messing with those could cause all manner of Bad Things.
Twitter Bootstrap comes packaged with a simple auto-complete library that’s stylistically integrated into the CSS framework. It’s convenient, but not the most-documented part of Bootstrap. I was working on a hobby project recently, and I wanted to have an auto-completing search field, but it…
PHP 5.5 will be gaining a simpler and more newbie-friendly way to securely hash passwords. As those who are active in the PHP community are all to well aware of, it is quite a trial to educate everyone on properly securing passwords in their…
There’s a post going around on Google Plus that shows off a glaring security hole in the popular internet radio site Pandora. If you use FireBug (or the HTML inspection tool in your browser of choice), you can see that the Password field on…
It’s 2012 and there are still an awful lot of high-profile websites leaking users’ passwords. Someone manages to snatch the database table, and then they crack the passwords, which are more often than not encrypted with weak MD5 or SHA1 hashes. It’s not enough…and…
Wouldn’t it be cool if you could host your own private GitHub, for browsing your local repositories or remote ones you host on your own server? Well, there’s a new PHP application in town that lets you do exactly that. GitList, the self-described “elegant…
Want to learn about Git and GitHub? It can save you hours of frustration by versioning your code and making it very easy to roll it back to an early date, or even create temporary branches where you can make major changes, and only…
So you want to add a file uploader to your site. It’s quite easy to do with PHP, but first you must understand the inherent risks. You’re going to allow just anyone to take a file and put it on your server. That file…
What’s the easiest way to figure out the width and height of an image, as well as the format of the file, in PHP? Given that the existence of a core function for practically everything is one of the language’s strengths, it’s unsurprising that…
Have you ever needed to have a script check whether a Minecraft server was online, or retrieve its listing information, like the “Message of the Day” (server description) or the number of active players? Maybe you run your own server, and want to display…