ropen: Remote “open” command for opening remote files locally on OS X

Posted by Tom on April 4th, 2009 — in Command line, Hacks, Linux, Mac, Programming, Uncategorized

The Problem

Most Mac OS X power users know about the “open” command line tool which opens the files specified as arguments in their default (or a specified) OS X application. Additionally, many OS X text editors, such as TextMate (”mate”) and SubEthaEdit (”see”), come with command line tools which can be used to open files.

These [...]

Determining the absolute absolute path of a shell script

Posted by Tom on March 30th, 2009 — in Command line, Hacks, Linux, Mac, Programming

In the course of working on projects like server-side Objective-J, jack, and now narwhal, I’ve often had to write shell scripts that needed to know their location in the filesystem. Rather than hardcoding it, I prefer to infer it automatically at runtime. Unfortunately this isn’t as easy as you would expect.

If the script is invoked [...]

Embedding and loading a JNI library from a jar

Posted by Tom on March 9th, 2009 — in Java, Programming

When I searched for ways to load a JNI library from a jar there were numerous hints of how to do it, but no code that I could find. So here’s my solution:

import java.net.URL; import java.util.zip.ZipFile; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream;

public abstract class UnixDomainSocket {

    static {         try {             // get the class object for this class, and get the location [...]

Game of Life text and image generator generator

Posted by Tom on February 7th, 2009 — in Programming, Ruby

I saw this image the other day on Hacker News and Reddit:

It’s a Game of Life pattern that prints out “Golly”. Neat, but I wanted my own. After about 5 minutes of playing around with the Golly logo pattern in Golly (a program for experimenting with the Game of Life), I gave up and wrote [...]

Ant Tasks for Git

Posted by Tom on November 13th, 2008 — in Git, Programming

Ant has tasks for CVS and Subversion, but none that I could find for Git. I threw together these simple Ant macros to get started:

<macrodef name = "git">     <attribute name = "command" />     <attribute name = "dir" default = "" />     <element name = "args" optional = "true" />     <sequential>         <echo message = "git @{command}" />         <exec executable = "git" dir [...]

A Better BugMeNot Bookmarklet

Posted by Tom on November 9th, 2008 — in Hacks, JavaScript, Programming, Ruby, Ruby on Rails, Web

BugMeNot is a great little service for bypassing the registration process for websites that really shouldn’t require it (ahem, nytimes.com). The bookmarklet brings up BugMeNot for the current website you’re viewing, and gives you login/password pairs which you can then copy and paste.

But wouldn’t it be better if it automagically filled in the username and [...]

Automagically Wrapping JavaScript Callback Functions

Posted by Tom on October 22nd, 2008 — in Hacks, JavaScript, Programming, Uncategorized, Web

One very nice thing about JavaScript is it’s support for first-class functions and closures. Crockford calls JavaScript “Lisp in C’s Clothing”. I’m no Lisper, but I enjoy I discovering new tricks or applications of functional programming in JavaScript.

I wanted to hook all the browser’s asynchronous JavaScript “entry points” : events, timers, asynchronous XMLHttpRequests, script tags, [...]

Recovering Censored Text Using Photoshop and JavaScript

Posted by Tom on October 8th, 2008 — in Hacks, JavaScript, Programming, Security, Uncategorized

My friend Andrew recently posted a teaser for a new project he’s working on, but with part of the headline pixelated to obscure what the project actually is. My curiosity got the best of me and I decided to do what any self-respecting geek would do: write a program to figure out what the censored [...]

git bisect run

Posted by Tom on October 1st, 2008 — in Git, Programming

This feature of git is too cool not to blog about: git bisect, and more specifically, git bisect run.

“git bisect” is a tool that facilitates a binary search of changes to your git repository to help find where a bug was introduced. You can walk through the process manually using “git bisect {good,bad,skip}“, or if [...]

ANSI escape sequences in JavaScript (color on the command line!)

Posted by Tom on July 16th, 2008 — in Command line, JavaScript, Programming

Recently I’ve been doing a lot of work in Rhino, Mozilla’s JavaScript interpreter written in Java. While it’s a bit slower than some of the other JavaScript interpreters out there it has the advantage of being able to call Java libraries. This is immensely useful since JavaScript is pretty bare-bones in terms of built-in libraries.

Anyway, [...]



Warning: include(/home/tlrobinson/tlrobinson.net/_footer-analytics.php) [function.include]: failed to open stream: No such file or directory in /home/tlrobinson/tlrobinson.net/blog/wp-content/themes/clean-look-150/footer.php on line 13

Warning: include() [function.include]: Failed opening '/home/tlrobinson/tlrobinson.net/_footer-analytics.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/tlrobinson/tlrobinson.net/blog/wp-content/themes/clean-look-150/footer.php on line 13