I’ve been creating a zillion RewriteRules to perform 301 redirects, and the code has gotten ridiculous. I can’t even read it anymore.
I created a small tool that removes duplicate rules, reducing the number of matches that mod_rewrite needs to try. It also resolves chains of 301 redirects into a single redirect.
Check it out: Redirect Reducer.
If you get this error message during a test, it’s because jest isn’t making the network call. You need to make a mock for fetch(), replacing the network call with a fake.
Continue reading React Test TypeError: Network request failed
Several years ago, I wrote an article about this, and it was really a mess, but the PHP community understanding about autoloaders and namespaces was a lot worse than it is today. This article attempts to amend and supercede the original, and explain the magic.
Continue reading PHP Namespaces and Autoloaders, Reviewed
I was thinking about how facebook updates parse out the url, then construct a nice looking preview. I think what it takes is scanning the textarea for a url, and then using ajax to tell the server to fetch a summary of the page at the url. get the data back, and insert it into a template, and reveal it.
This is a republication of a post from January 2012. I would not write it this way today.
Continue reading Facebook-style Previews
Over here in Los Angeles, and the Southwest in general, there are a lot of people from who have Mexican or Latin American heritage, and have Spanish surnames.
The challenge with these names is twofold.
Continue reading Heuristic Hispanic Surname Extraction with Regular Expressions