rahji.com

Main menu:

Site search

Categories

My Other Sites

People

Places

Stuff from the 'scripting' category

How to get your RSS feeds out of Mail.app (and into NetNewsWire)

If you use Mail.app to read RSS feeds and want to export the URLs for those feeds (maybe you want to use some other RSS reader now?), you can use this command.

PHP Countries, States and Provinces

I modified my phpstates code include to display countries and Canadian provinces as well. The country codes come from the UPS developer’s API. This is another one of those snippets that I use often, so maybe it will help you out.

Perl template for TextMate

Here’s how you can create perl scripts in TextMate, starting from a template instead of a blank screen.

Simple credit card number validation with PHP

I was looking for a quick and simple PHP function that would validating credit card numbers, but the code I found was mostly clunky and sometimes just wrong. I wrote this function and it seems to work correctly. Feel free to use it and leave a comment here if it works for you.

Finding remote host info

This is how I find out where a remote client is coming from. It takes into account proxies and tries to get the hostname using gethostbyaddr(). Frankly, this was written many years ago so I’m not sure if I’d do it the same way. If nothing else, it should be a good [...]

Creating a 1px GIF with Perl

Ever wanted to create a 1 pixel transparent GIF with Perl? Me neither, but this is still neat to have in the toolbox.

Going from Perl to php

I wrote this cross-reference a while back for people who know how to program using Perl and are looking for some of the familiar Perl functions in the php language. When I originally write it, we were stuck with php 3 so I just reworked the list to include some of the functions that were [...]

Compressing URLs to make them shorter

This one time, I thought maybe I’d try compressing URLs to make the query strings shorter.

Creating a SELECT list of states with php

I’m posting this short chunk of php code that might save you a few minutes. It creates a list of US states in an HTML or XHTML SELECT list. Download the zip file here.

Boilerplate template for Javascript

Here’s a template for adding javascript code to an HTML page. It might save you 30 seconds someday.