Currently Browsing Posts Tagged Programming

Version Control Best Practices

This is an excellent article from the makers of Tower[ref]Tower is an excellent app for managing git repositories; a bit pricey, but there is a 30-day free trial. Check it out.[/ref]. It’s written assuming you’re using git, but there are a lot of great points if you’re using any source code management solution:

  1. Commit Related Changes
  2. Commit Often
  3. Don’t Commit Half-Done Work
  4. Test Before You Commit
  5. Write Good Commit Messages
  6. Version Control is not a Backup System
  7. Use Branches
  8. Agree on a Workflow

Be sure to read the original article to see an explanation of each point.

[references/]

Spree Tip: Adjust Permissions for Extended Controllers

I’ve been working with Spree over the past few weeks for my senior project. So far, I’ve really enjoyed working with it. For being a below-1.0 software, it is very stable, and very full-featured. Even better, it’s very easy to create extensions and integrate them into the e-commerce framework. However, I was running into a permissions issue with an extended controller method. Continue reading…

Clearing Floats With WordPress

Using a “float” in a web design is fairly common these days; it is used to float images for wrapping text, as well as being one of the easier, standard-compliant methods to achieve columns. For example, if you want to have a content column, with a sidebar column floating to the right, you would probably have something similar to this (example after the jump):

Continue reading…

Cisco Clean Access + Mac OS X = Headache

At Ferris State University, the network implements a system called Cisco Clean Access (CCA). This is a system designed to keep all Windows-based computers up-to-date, secure, and authorized to use the network. On the Windows-side of things, it works decently. All that is truly required is the installation of Clean Access Manager, Norton Antivirus, and setting up your Windows Update settings to point to FSU’s Windows Update Server.

This is totally different if you use a Mac (or Linux, or any other OS). While there is technically a Mac client for CCA, it does not work as well as the Windows-based client. Luckily, there is still a backup plan for other operating systems: CCA will redirect you to a web-based login page, you fill in your user credentials, and bam! you’re on the network. Only a few caveats:

  • If you disconnect from the network for any reason (i.e. you’re using a laptop and you close the lid) for more than 5 minutes, you will have to re-login
  • Occasionally there are issues with computer identification and DHCP: I have run into issues where I was logged in, closed my laptop for 15 minutes, and was given an “IP in use” error. This has happened on more than one occasion, and not only to me, but a few of my classmates.
  • It’s just a hassle to have your web session interrupted by a Java app (and on that point, why is it a Java app? I’m pretty sure a standards-compliant web form would suffice) asking you to login

To get around most of these issues, I came up with a script to automatically login with my iMac. Essentially, it’s just a shell/bash script that is executed by launchd (you could use Cron on *NIX) every 5 minutes.

Continue reading…

Git, Capistrano, SSH, and WordPress

Update: This tutorial has been updated! Several bugs have been fixed, please be sure to read all of the updates (especially if you’ve referenced this tutorial before).

Also, there is now a gem to help with the deployment script. Please visit the new tutorial after reading this one for more information.

I’m not going to lie: lately I’ve been on quite the WordPress-kick. I love being able to create a design, cut it up into HTML-ready chunks, and then use a standard WordPress template to get it into production and on the web ASAP! Generally, my workflow looks like this:

  1. Create the design
  2. Cut it up for a web layout
  3. Create a sample web layout and test across browsers
  4. Cut the HTML up into a standard WordPress template
  5. FTP the design to a WordPress install (into the wp-content/themes directory)

Continue reading…

Sanitizing Phone Numbers With C#

An extension method to remove all but digits from a phone number. This should be useful for sanitizing input to put into your database.

using System.Text.RegularExpressions;

namespace CustomStringMethods
{
	public static class PhoneNumber
	{
		#region Class Methods

		public static string StripAllButDigits(this string s)
		{
			return (s == null) ? string.Empty : Regex.Replace(s, @"\D", string.Empty);
		}

		#endregion
	}
}

Obviously this can be used for more than just phone numbers.

Page 1 of 212