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.
“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…”
“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,…”
“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…”
“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,…”
“What was this /private/etc/httpd/users/sarah.conf that it was talking about? I had never created this file. I checked and it certainly existed. It also had an Options line without ExecCGI–bingo! I simply removed the file because it was just redefining what I had already specified in httpd.conf for Users/*/Site directories (shown above). I then restarted Apache and voila, my scripts worked.”
“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…”
“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…”
“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…”
“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…”
“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…”
“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…”
“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…”
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.
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. |
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. |
I don’t particularly like C++, but I’ve had to use it for various classes and also in a programming job I had. I figure it’s a good language to know, but it’s never my first choice when writing a program.
“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.”
“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;…”
“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…”
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.
“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…”
“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,…”
“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…”
“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 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.
“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:…”
“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…”
“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…”
“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…”
“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…”
“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…”
“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…”
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.
“What was this /private/etc/httpd/users/sarah.conf that it was talking about? I had never created this file. I checked and it certainly existed. It also had an Options line without ExecCGI–bingo! I simply removed the file because it was just redefining what I had already specified in httpd.conf for Users/*/Site directories (shown above). I then restarted Apache and voila, my scripts worked.”
“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…”
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.
“This will run various Ruby Gems for creating code quality reports, store them in public/ in your Rails app, and create public/reports.html with links to each report. You need Saikuro, Flog, Flay, Ree…”
“I got this error in my Rails app because I was trying to sort an array of symbols: undefined method `’ for :my_symbol:Symbol. I defined the spaceship method for the Symbol class and included the Com…”
“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.”
“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,…”
“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…”
“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…”
“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…”
“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….”
“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…”
“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 succinctly — 7 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…”
“…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…”
“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.”
“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…”
“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…”
“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…”
“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…”
“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 logical combinations of accents and letters.”
“It’s pretty easy to extract just the audio from a DVD in Linux, using Mplayer, sox, and either Audacity or split.”
“Don’t look on this guide as though you have to learn all this stuff right now in order to be able to use Linux. No. You can get around otherwise, enjoying Linux and getting work done at the same time without messing around with the command-line, which is what a lot of this guide deals with. Look over this guide and then pick and choose what you need. Want to learn how to change file permissions? Check out the section on the
chmodcommand. Want to know what program to use for a certain task? Check out that section. You don’t have to memorize all this stuff to get around, but it’s there if you need it.”
“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.”
“To make it more convenient for me to take clean notes, as opposed to notes filled with “x^2″ and “y_j”, I looked into changing the key bindings in OS X.”
“eval `/opt/local/bin/lesspipe.sh`
function dir_access_color {
local DIR=”${1-$PWD}” COLOR=0
[[ -r "$DIR" ]] && COLOR=1 # red
[[ -w "$DIR" ]] && COLOR=2 # green
tput -S <<<$'bold\nsetaf '"$COLOR"
}”
“” Indentation
set autoindent ” Use the current line’s indent level to set the indent level of new lines
set smartindent ” Attempt to guess the indent level of any new line based on the previous line
set smarttab
set wrap ” Wrap long lines visually, but don’t actually insert breaks
set expandtab
set shiftwidth=2”
“# active borders on the desktops
EdgeResistance 250 10
EdgeScroll 100 100
ClickTime 750# make sure these fonts exist on your system:
WindowFont -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-*
IconFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*”
“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.””
“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.”
“To make it more convenient for me to take clean notes, as opposed to notes filled with “x^2″ and “y_j”, I looked into changing the key bindings in OS X.”
“What was this /private/etc/httpd/users/sarah.conf that it was talking about? I had never created this file. I checked and it certainly existed. It also had an Options line without ExecCGI–bingo! I simply removed the file because it was just redefining what I had already specified in httpd.conf for Users/*/Site directories (shown above). I then restarted Apache and voila, my scripts worked.”