• C++ shell with forks and pipes ·

    As an assignment for my operating systems class, we were to write a shell in C or C++. I’m putting my work here under the GNU General Public License v3 in hopes that it will be helpful for someone else, presumably some future student arguing with the C language, which I find infinitely frustrating to work with sometimes.

  • my Qbee PHP script ·

    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:

  • regular Javascript v. AJAX for dynamic content insertion ·

    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 schools, and the user might need to submit data for multiple courses a student has taken. Hence, the user needs to be able to add extra course sections on the fly, as they’re necessary.

  • make your Mac listen up ·

    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 favorite sites, and it does this when I tell my Macbook “Get on it.” Here’s how I did it:

  • chmodding and Ruby ·

    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. This, however, is not the case on a UNIX-like file system like OS X. In order to save myself the hassle of manually chmodding thousands of files, I wrote this Ruby script:

  • using Ruby to rename files and edit their content ·

    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, and instead, all files with the extension .sphp would now run as PHP scripts. Since my employer’s site was built using PHP, that meant all of its pages were showing the source code instead of actually executing. I had to whip up a quick Ruby script in order to:

  • finding invalid foreign keys in Rails ·

    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 models, Book and Author, such that each Book has an author_id which connects with Author via its primary key, id. That is, the tables are: books(id, author_id) and authors(id). Each table probably has fields other than that, but those are the only fields we need to worry about. Below is a method that generates an unordered HTML list for display to the users: