Categories
Career Development Emacs Programming

How Emacs Changed My Life

I became aware of Emacs in college but stuck with Vim. I was naive and thought no one used Vim except me. I felt proud using something “hackers” used, as if choosing a text editor made me special. Little did I know that switching to Emacs would fundamentally change how I approach programming.

Categories
Arduino Hardware Programming Tutorial

Accessing Virtual Hosts with Arduino Ethernet Shield

If you've worked with the Arduino Ethernet Shield, you've probably noticed a limitation: while you can connect to an IP address, you can only reach the default virtual host on that server. This becomes a problem when working with shared hosting or VPS servers that host multiple websites on a single IP address.

The Problem

Modern web servers commonly use virtual hosting to serve multiple websites from a single IP address. When you make a basic HTTP request to an IP, the server returns the default site—not necessarily the one you want. On commercial shared hosting, you typically can't make your site the default host.

Categories
Customization Programming Ruby Tutorial

IRB Console with History and Logging

I spend most of my time working with IRB (Interactive Ruby) or Rails console. Over time, I've settled on a configuration that provides essential features like persistent command history, autocompletion, and Rails-specific logging. These improvements make the Ruby REPL much more productive for daily development work.

What is IRB?

IRB (Interactive Ruby) is Ruby's built-in REPL (Read-Eval-Print Loop) – an interactive shell for experimenting with Ruby code. It's invaluable for testing code snippets, debugging, and exploring APIs. When working with Rails, the Rails console is essentially IRB with your application's environment loaded.

Categories
Emacs Programming Technology Tutorial

Power Programming with Tags

Source tagging is a powerful source code navigation system that rivals modern IDEs. If you're using Emacs, Vim, or TextMate, you can use ctags for fast code navigation. Here are the steps to set it up.

Step 1: Install ctags

For Mac:

$ sudo port install ctags

Step 2: Create a Tag File

Navigate to your project and generate tags:

Categories
Programming Web Development

Prevent Googlebot Following Links in Gmail

If you run a mailing list or send automated emails with links, you may have noticed something strange: Googlebot is following links sent to Gmail subscribers, which can trigger unsubscribe actions or inflate download counts.

Why Common Solutions Don't Work

The typical approach—using robots.txt or adding rel="nofollow" to links—doesn't work for email links. These methods only apply to web pages, not email messages. When Gmail displays emails in the web interface, Googlebot can still crawl those links.

The Solution: User Agent Filtering

The best approach is to detect and handle Googlebot requests at the server level. Check the user agent string in incoming requests and filter out bot traffic before processing actions like unsubscribes or incrementing download counters.

Categories
Learning Personal Growth Programming

Stop Doing What You’ve Always Done

If you keep on doing what you've always done, you'll keep on getting what you've always got.

W. L. Bateman

Categories
CoffeeScript JavaScript Programming

Getting Started with CoffeeScript: JavaScript’s Better Half

Introduction

I love JavaScript, but let's be honest – the syntax can be clunky. Verbose function declarations, confusing this binding, lack of classes, awkward loops. JavaScript is powerful, but it could be prettier.

CoffeeScript addresses this. Created by Jeremy Ashkenas (of Backbone.js and Underscore.js fame), CoffeeScript is a language that compiles to JavaScript. It keeps JavaScript's good parts while fixing the annoying bits.

Categories
Emacs Programming Ruby on Rails

Can Your Editor Do This? Emacs for Rails Development

Here's a challenge for your Rails development environment: Can your editor run a web server inside itself, capture runtime errors as they happen, and automatically jump to the exact line of code that caused the problem?

If you're using TextMate, Vim without extensive configuration, or a basic text editor, the answer is probably no. But if you're using Emacs with Rinari, this is exactly what you get.

Categories
Learning Programming

Programming Republic of Perl

I've decided to dive into Perl, and I'm starting with Learning Perl by Randal Schwartz and Tom Phoenix. As someone who's mainly worked with more conventional languages, Perl's philosophy and governance model are fascinating.

The Benevolent Dictator

One of the first things you learn about Perl is that it's not governed by committee or corporation—it has Larry Wall, its creator, who serves as the "Benevolent Dictator for Life." The community has even codified this into the "2 Rules":

Categories
Programming

SVN & Git-SVN

Version control is essential for software development, and in 2008 we're in an interesting transitional period. Subversion (SVN) is the dominant centralized version control system, but Git is gaining momentum fast. Many teams use SVN for their repositories but want Git's powerful local branching and workflow features.

Enter git-svn: a bridge that lets you use Git as your local client while working with SVN repositories.