Geeky Stuff

Here you’ll find articles, tutorials, configuration files, scripts, and source code related to computers and the Web. All source code is released under the GNU General Public License (GPL). If you don’t find what you’re looking for here, you might try my friend Jem’s site, Tutorialtastic.

Web Development

Articles

  • regular Javascript v. AJAX for dynamic content insertion27 Feb 08

    Recently for work, I’ve had cause to write functionality so that a certain chunk of a form can be inserted again, over and over, by the user. The form involves data about course equivalencies between…

  • using Javascript and CSS to mark outgoing links26 Sep 07

    It may be useful to your visitors to know which links will take them off of your site without having to hover over all of them. It might also be a nice touch to mark links pointing to PDF documents,…

  • using AJAX to spiff up a gallery3 May 07

    Lightbox is nice and all, but sometimes I find it clunky, particularly in Firefox when I have a lot of other tabs open. However, I don’t want to go the route of having an image load by itself in the…

  • how to be a snobby web designer30 Mar 07

    I’m not talking about the attitude that comes across in your writing, but instead how you design your pages. I’ve seen these problems crop up from time to time on various sites and it always bugs me,…

  • using Perl and Apache on OS X22 Mar 07

    I’m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server. At first, I was getting just the source of the Perl files spit bac…

  • custom shapes in Photoshop3 Aug 06

    Custom shapes can be very useful for making multiple objects that look the same. For example, say you want several photos to all be cut out of the same shape, like this:

    Creating a Custom Shape…

  • Clichés of a Crappy Site23 Dec 05

    If you’ve browsed through many personal sites at all, you’ve probably seen some of the following things that make me personally cringe. I don’t understand why they’re so trendy, since they don’t impr…

  • simple photo gallery script21 Jul 05

    A very simple photo gallery tool. It displays a set of thumbnail images (made by you) and then each individual image when clicked.

    Requirements

    You need PHP support on your server. An easy wa…

  • why I love my CMS14 Jul 05

    For many years (most of my web designing history, really), I maintained all my pages myself with only an HTML editor and scp for uploading. I saw many other sites that used tools like WordPress, Mova…

  • neat code23 Jun 05

    One of the easiest ways to keep your code easy to update, read, and debug is to keep it neat. That means indentation, documentation, consistency, and logic need to be applied. These are basics in an…

  • steal my code!23 Jun 05

    I was just reading a review that said:
    “So many webmaster/mistresses on the web are so afraid of having their code stolen. Does it really matter?” yes, I think it does matter. Particularly for pe…

  • the alt attribute6 Jan 05

    Each time that you use <img> or <area>, you should include the alt attribute. An alt attribute is generally a short description of what the <img> or <area> contains or is pert…

Presentations

I’ve had to do a couple of presentations over the years to inform others about web design topics, and I figured you guys might benefit from them as well. Please do not replicate these elsewhere or attempt to edit them, claiming them as your own.

CSS presentation thumbnail
View PDF »
This lasted about an hour, if I remember correctly, and skimmed over HTML and CSS basics before delving into guidelines for improving a web page’s appearance through CSS. The audience was my fellow college students who may have had some knowledge of HTML and CSS, but no background in professional web design.
Intro. to web design presentation thumbnail
View PDF »
This is a very basic introduction on how to go about creating a web page. It was to last for about ten minutes and given to an audience of middle schoolers. See also the handout I made for them containing links to various resources.

Programming

C++

I worked with C++ mainly my freshman year for two classes I had. While I liked it all right at the time, in retrospect after having grown accustomed to Ruby, it feels very clunky and archaic.

  • enqueue and dequeue15 Nov 05

    Source for enqueue() and dequeue() functions to add and remove data from a queue in a class.

    Node Struct Definition
    struct node {
    string what; // Used for brand
    string serialNumber;…

  • Makefile15 Nov 05

    In a Unix environment when working with C++ or C, a Makefile can be a very handy thing. Instead of typing several separate commands each time you update a file and want to recompile, you can just typ…

Javascript

I’ve gone from hating Javascript to really enjoying it. When used correctly, it can add a lot to a site, and I enjoy working with it.

  • regular Javascript v. AJAX for dynamic content insertion27 Feb 08

    Recently for work, I’ve had cause to write functionality so that a certain chunk of a form can be inserted again, over and over, by the user. The form involves data about course equivalencies between…

  • using Javascript and CSS to mark outgoing links26 Sep 07

    It may be useful to your visitors to know which links will take them off of your site without having to hover over all of them. It might also be a nice touch to mark links pointing to PDF documents,…

  • using AJAX to implement a live search14 May 07

    I recently implemented a live search on the quotes page, so I figured I’d give a tutorial on how I did it. A “live” search is like a regular search feature, but if the user has Javascript enabled, th…

  • using AJAX to spiff up a gallery3 May 07

    Lightbox is nice and all, but sometimes I find it clunky, particularly in Firefox when I have a lot of other tabs open. However, I don’t want to go the route of having an image load by itself in the…

PHP

PHP is the first language I really loved, because it just seems like the perfect generic language. It’s very comfortable and easy to work with.

  • my Qbee PHP script21 Mar 08

    I’m a member of the Quilting Bee and I use a very simple PHP script I wrote for displaying my quilt. I figure someone else might get some use out of it, so here it is for your coding pleasure:…

  • using AJAX to implement a live search14 May 07

    I recently implemented a live search on the quotes page, so I figured I’d give a tutorial on how I did it. A “live” search is like a regular search feature, but if the user has Javascript enabled, th…

  • using AJAX to spiff up a gallery3 May 07

    Lightbox is nice and all, but sometimes I find it clunky, particularly in Firefox when I have a lot of other tabs open. However, I don’t want to go the route of having an image load by itself in the…

  • image generation in PHP11 Mar 06

    Creating images on-the-fly can be a very useful skill. Using PHP’s built-in image generation functions, it’s pretty easy, too. This tutorial will detail how to have the titles of blog entries show u…

  • simple photo gallery script21 Jul 05

    A very simple photo gallery tool. It displays a set of thumbnail images (made by you) and then each individual image when clicked.

    Requirements

    You need PHP support on your server. An easy wa…

  • random quotes with PHP8 Jun 05

    So you want to display a randomly selected quote on your page, and you want to use PHP to do it. It’s dang simple, let me tell you.

    RequirementsYou need PHP support on your server. An easy way to…

  • more dynamic sites through PHP8 Jun 05

    A couple of reasons to use PHP in your site:
    Separation of content from design–when you want to change the look of your page, you can update a few files and every page of your content will be update…

Perl

I must admit, Perl kinda scares me. It’s like the 1337 language of über geeks, and I worry that I don’t grok enough to properly use it.

  • using Perl and Apache on OS X22 Mar 07

    I’m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server. At first, I was getting just the source of the Perl files spit bac…

  • extensionChanger.pl18 Dec 05

    This script will rename all files with one extension to another extension. Example: all files in a given directory that end with .php will be renamed to end with .txt.

    Download the program and in…

Ruby

Ahh, Ruby. This is my absolute favorite language. It has a beauty and grace to it like I’m waxing poetic about something more than a programming language.

  • chmodding and Ruby1 Feb 08

    Recently, I switched from a Powerbook to a Macbook, and to copy my files from one to the other, I used a pen drive. Since my pen drive has a FAT file system, it treats everything as being executable….

  • using Ruby to rename files and edit their content21 Nov 07

    Recently at work, the web admin for the computer science department came into our lab and told us that my employer’s site was broken. The admin had need to make all .php files not act as PHP scripts,…

  • finding invalid foreign keys in Rails15 Nov 07

    Sometimes it would be useful to tell users of your Ruby on Rails application if there is a problem in the database, such as some foreign keys are invalid. As an example, let’s assume you have two mod…

  • the many methods to #find things in Rails22 Nov 06

    For the longest time, I didn’t understand the full power of the various #find methods in Rails. I probably still don’t, but my view of them has certainly expanded. I used to use plain ol’ #find for…

  • #post method in tests with a different controller14 Nov 06

    I wanted a #login method in test_helper that would allow me to easily login from any of my functional tests. However, the #post method won’t allow you to set a different controller than the one in the…

  • go from model to associated table name and back31 Aug 06

    Given a table object, it returns the related string object; e.g. SubAttribute => ’sub-attribute’. Useful if you want to make a list of all your tables with perhaps their fields listed out to the side….

  • conditioner for ActiveRecord-friendly conditions from a collection31 Aug 06

    I frequently have a collection of values that I want to match in an ActiveRecord query, but it would be nice if I could let ActiveRecord handle checking the data and escaping it properly. So, I wrote…

  • simple Rails preference storage11 Aug 06

    So you’ve got some Rails application and you need to store information from the users across their interactions with the app. Here’s a simple, straightforward way to do that.

    In your controller:…

  • if succinctly7 Jun 06

    In Ruby, if is an expression, not a statement, thus it returns a value. This may not seem useful at first glance, but it lends itself to forming neat, concise code… Like most things in Ruby, actua…

  • the power of yield28 May 06

    …and super. These two keywords allow you to pass control back and forth between parent and child methods, to weave power between a more general method (in the parent class) and a more specific meth…

Linux

  • chmodding and Ruby1 Feb 08

    Recently, I switched from a Powerbook to a Macbook, and to copy my files from one to the other, I used a pen drive. Since my pen drive has a FAT file system, it treats everything as being executable….

  • Grub Error 1725 Oct 07

    I just had an interesting time with trying to boot into Linux on my PC. Last night, I noticed my /boot/grub/menu.lst file had gotten overwritten when I performed some Ubuntu updates. This meant I ha…

  • how to reformat your pen drive19 Apr 07

    USB pen drives are everywhere these days, and for good reason, since they’re dead useful. I use mine with my Linux box, my Powerbook, and various other systems I’ve had cause to stick it in. After a…

  • the ease of Linux with a focus on Ubuntu5 Apr 07

    3till7.net had some excitement yesterday because a post from 2005 got Dugg, and is also garnering a lot of hits from StumbleUpon. I find this funny because it’s such an old post but also because the…

  • ad blocking through /etc/hosts4 Mar 06

    There are several ad sites that you’ll see being used everywhere. They slow down page loading, even on fast connections, because sometimes there’ll be lag and they won’t load immediately and instead…

  • non-English characters in Linux28 Dec 05

    It’s easy to make accented characters (e.g. é and ü) in Linux. Easier than in Windows, actually, because in Windows you have to remember all those crazy Alt codes, and in Linux, it’s logi…

  • extracting audio from a DVD24 Dec 05

    It’s pretty easy to extract just the audio from a DVD in Linux, using Mplayer, sox, and either Audacity or split.

    First you need to get the audio from the DVD into a WAV file:
    mplayer -vo null -…

  • beginning Linux guide21 Dec 05

    This was taken from an email I sent to Jem and Trinity about beginning in Ubuntu Linux. It might also be useful to see my dated Beginning Linux Commands guide. Any questions about something I do or…

  • Beginning Linux commands5 Jul 04

    A table of commands that were useful to me when I first began using Linux. Note that all of these may not apply to your particular distribution, configuration, etc.

    Command
    Purpose…

Config Files

  • DefaultKeyBinding.dict6 Nov 07

    I take class notes on my Powerbook, and often I take mathematical notes that involve superscripts and subscripts. To make it more convenient for me to take clean notes, as opposed to notes filled wit…

  • .bash_profile5 Nov 07

    Here is my .bash_profile, used to specify settings when I open a terminal. It’s customized for OS X, but should be adjusted fairly easily to Linux or another *NIX-style operating system with bash….

  • .vimrc11 Nov 04

    My current .vimrc file for the text editor vim:

    I generated the above HTML file, which represents how my .vimrc file looks when open in gvim, by doing the :TOhtml command in gvim. I use the co…

  • .fvwm2rc1 Jan 04

    Here is my old .fvwm2rc configuration file for the F Virtual Window Manager.

    # path to the images
    ImagePath /usr/share/icons/mini:/usr/local/icons:/usr/local/icons/TkDesk:\
    /usr/share/icons:/usr/…

Mac

  • make your Mac listen up4 Feb 08

    I’m so tickled I can’t stand it. All right, so Speech Recognition stuff on a Mac is pretty darn cool by itself, but now I’ve got a nice Apple Script that opens up Safari with various tabs of my favor…

  • chmodding and Ruby1 Feb 08

    Recently, I switched from a Powerbook to a Macbook, and to copy my files from one to the other, I used a pen drive. Since my pen drive has a FAT file system, it treats everything as being executable….

  • DefaultKeyBinding.dict6 Nov 07

    I take class notes on my Powerbook, and often I take mathematical notes that involve superscripts and subscripts. To make it more convenient for me to take clean notes, as opposed to notes filled wit…

  • using Perl and Apache on OS X22 Mar 07

    I’m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server. At first, I was getting just the source of the Perl files spit bac…