InfiniteRed’s IR_Black theme is my favorite color scheme for programming. I use it in both Textmate and Vim.
I’ve been playing around with Xcode recently due to some iPhone programming, and was sorely missing IR_Black. To that end, I’ve ported it to Xcode, mimicking as closely as possible the color choices used in the theme.
Here it is: IR_black_xcode.zip
Note: I’m using Inconsolata-dz as my font. If you wish you change it, the easiest way is probably editing the .xcolortheme XML directly, and doing a search and replace.
To install, put it in ~/Library/Application Support/Xcode/Color Themes/.
Here’s what it looks like:
Let me know if there are any issues!
http://github.com/dz/chisel/tree/master
I’ve been thinking about playing around with static generated blogs. I had some free time, so I wrote a small python script that’ll take a directory of files, and using jinja2, generate the relevant archive/detail/index pages.
It’s (horribly) inefficient, since it’s basically passing around lists of all files, but it’ll do for now.
It clocks in at around 116 lines of code, so it’s not too hard to modify if any feel so inclined. I’ve attempted to build in some flexibility with the @step decorator, but we’ll see how well that pans out.
I’m considering shifting this blog to Chisel in the near future. I like the idea of my blog posts being just plain text files on the filesystem. Reminds me of the glory days of Blosxom.
I love WebFaction. Why?
This is a list of the apps I have running in WebFaction. I have five separate Django apps and four PHP sites. I’ve not come across anything short of a full blown VPS or dedicated server that gives me this level of flexibility.
The best part?
I’m on their lowest month-to-month plan, paying a mere $9.50 a month. If I prepaid, that goes as low as $5.50 a month.
And I’ve never noticed any slowdowns.
I call it the wait-until-it-breaks method of bug fixing.
Earlier last week, I accidentally upgraded the version of Django powering nodnod to the latest SVN revision. This is important and unfortunate. Why? Because due to laziness, nodnod.net was still coded to a revision of django trunk that dates from circa late 2006. Upgrading to the latest SVN has meant there’s two years worth of backwards incompatible changes to go through.
The laziness that’s spawned the problem has not gone away, so I’ve decided to fix bugs as I see them. Every time I get an exception emailed to me, I fix the issue. Thus far, after doing so for the past several days, most of the biggest things seem to be fixed1.
It was surprisingly easy — the list presented at the BackwardsIncompatibleChanges page is very clear, and tracking down the problems didn’t take any significant effort.
So don’t fret if something seems to break. Changes are an email is on its way to my inbox, and it’ll get fixed shortly.
Chief among the offenders were pagination, old-style inner class Admin declarations in models, and a search and replace of newforms to just forms.↩
I hate writing VimScript —I just feel uncomfortable with it. As such, when writing Vim commands and extensions, I tend to use either Ruby or Python. In this case, I needed to easily sanitize text copied from Microsoft Word that contained curly smart quotes and curly apostrophes. The following likely isn’t the fastest or even best way to do it, but it was a quicky, easy command to write:
python << EOF
def zap():
import vim
def strip_gremlins(s):
s = s.replace(u"\u201c", "\"").replace(u"\u201d", "\"") #strip double curly quotes
s = s.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u02BC", "'") #strip single curly quotes
return s
r = vim.current.range
for index, line in enumerate(r):
r[index] = strip_gremlins(line.decode('utf-8')).encode('utf-8')
EOF
command! -range=% Zap python zap()
The last last lets me type :Zap instead of having to type :python zap().
I like to set Vim’s softwrap to something sane — meaning, it wraps by words. The following does so:
set wrap linebreak textwidth=0
It’s amazing what Reddit, even programming.reddit, will do to your traffic. Well, proportional to what it was previously, anyway:
Mozilla Labs, who apparently have a plethora of money and free time, developed an experimental editor using canvas and javascript called Bespin
It’s a neat technical achievement, but I don’t see the utility. My worst nightmare is being forced to code in random locations, same editor be damned. So the “access your editor from any browser!” isn’t terribly enticing.
The choice to use column view rather than tree is interesting, but for me, flawed. I can’t stand column view. It’s like a tree except you can only view a single branch at a time. What’s the point of that?
I do like their color theme though.
Multiple people have told me in the last couple hours that Inconsolata, the font I mentioned in the previous post, is meant for print, and not for the screen.
And yes, I know that. It says so right on the font’s page: “It is a monospace font, designed for code listings and the like, in print.”
But at a large point size, and with proper antialiasing, there’s a noticeable difference between Inconsolata and something like Consolas. To me, at that size and resolution, Inconsolata looks more open, more inviting — warmer. It’s a monotype font that has a little bit of the soul of a proportional font; not completely cold and uniform, but with hints of humanistic touches.
Obviously, some people might not prefer that. And honestly, I also very much enjoy Consolas. It’s an awesome font, despite my preference for Inconsolata.
But really, what it came down to was my specific annoyances with each font and the avenues I had available to address those annoyances.
Consolas has a (retardedly) short hyphen or dash (the - character). It looks cut off. It looks hurried. It looks like a misplaced scratch rather than an actual character.
Inconsolata had the single and double quote annoyance.
So why did I choose to fix Inconsolata rather than Consolas?
From a purely practical point of view, it was the one that let me. The Font Forge source for Inconsolata is available, and readily lets anyone change the font glyphs to suit their purposes. Whereas Consolas is a Microsoft font, and doesn’t really have easy ways to slightly modify glyphs like extending its hyphen out by a bit.
That said, I hardly think of myself a font connoisseur of any ability. So maybe it is meant for print and not for screen. All I can really say is it looks quite okay to me.
I love the font Inconsolata. At bigger sizes and higher resolutions, it looks incredibly smooth and clear, and avoids the messy sort of feeling that Monaco gains as text density increases.
One thing that bothered me about Inconsolata, however, was the fact that its single and double quotes were slightly slanted or curly. It especially bothered me when using single quotes and commas, as the two looked visually similar, and my eye kept jumping levels.
As such, I made my own modification using the Font Forge source script, and named it: Inconsolata-dz
It was the first time I did anything with Font Forge, so advance apologies for any mistakes.
Here’s how it compares to the normal version of Inconsolata:
Note the single and double quotes, and how the single quote is more visually distinct from the comma.
I’ve uploaded to: http://media.nodnod.net/Inconsolata-dz.otf.zip. Grab it there.
I've been using NERD tree in Vim for a while now, liking the way it easily presents the files I'm working on in a tree format. Unfortunately, many times, I don't need all the files that it lists. And other times, the files I do need are scattered across disparate locations.
So I went looking for another solution, and think I've found it. Project.vim.
At its root, the plugin takes advantage of Vim foldings to show and hide groups of directories and files. Here's what it looks like in action:
The file listing on the left may look a little arcane, but is actually very easy to create. It's possible to manually create it, but I find it typically easier to using one of Project.vim's commands: \C
Given these files:
I go into a Vim window, and type :Project. This will initially open up an empty project window. I already have one in there, but no matter. A single Project file supports multiple groupings.
Type \C in the Project window, and a prompt will display.
Above, I've titled the project "Django Trunk". It will then ask you for the path to the root directory of the project:
Eventually, it will ask you for a file filter. The format is a standard file glob syntax.
Let it parse through the directories and eventually you'll end up with:
Now you can use the standard vim folding commands to navigate. Or you can use arrow keys, / searching, or any manner. At its core, the Project window is a standard Vim buffer. The Enter key toggles foldings open and close. Pressing Enter on a file opens it in the most recently used window.
But what happens if there's a file or folder you need that's not in the project root? No worry, just add it in:
As usual, :help Project will give more documentation. But in brief, the basic syntax of the Project is:
Project_Name=Path_to_root_folder filter="Glob_filter" { }
The syntax is nestable, meaning that inside the curly braces, you can have another group defined using the same syntax.
The values also inherit from parent to child -- meaning if the path of a child isn't defined, it will take the path from the parent.
All in all, I find this to be more useful to me than NERD Tree. Once I set up my project, I see only the files I want to see without having to expand a massive tree.
I grabbed a copy of Programming Erlang a couple days ago. So far, so good.
Even if the prolog-esque syntax is harking me back to college programming theory classes.
//12.30.2008 — comments (0) — superdork , erlangSoft tabs in Textmate were getting annoying because I kept losing track of block levels. With hard tabs, turning on invisible characters shows the tabs, giving an easy visual indicator of the current line’s block level or block depth. With soft tabs, however, there’s just a big expanse of space.
The following Textmate command is a naive scanner that takes the current line and spits out the block level. It assumes that the programmer is sane — meaning, that hard tabs and soft tabs are not mixed. It further assumes that if soft tabs are used, only soft tabs are used, and that leading spaces are cleanly divisible by the soft tab size.
There very well may be something out there like this already, but I’m lazy and too tired to search.
#!/usr/bin/env python
import os
import re
if os.environ['TM_SOFT_TABS'] == 'YES':
tab = " " * int(os.environ['TM_TAB_SIZE'])
else:
tab = "\t"
print re.match("(\s*).*", os.environ['TM_CURRENT_LINE']).group(1).count(tab)
I have it assigned to control-option-b.
Alex recently wrote about some of the different ways he uses Textmate.
I don’t know too many people who use Visor, so I figured I’d illustrate some of the different ways that Visor plays into my workflow.
At my job at Threespot, I spend a fair amount of time working with front-end code. Typically, I’ll have Textmate, Photoshop, and any number of browsers open. I started using Visor a couple years ago, after the Ars Technica thread that first introduced the idea managed to get some impetus after the developer behind Quicksilver whipped up a prototype. Even since then, it has gradually taken an ever more prominent space in my short cuts list.
Last year, it finally stole the prime Command-Space shortcut from Spotlight. Currently, my Mac has Spotlight regulated to Control-Space.
So without further ado, a series of annotated screenshots. Click on them for larger versions.
This is Visor. I press Command-Space, and a terminal drops down over my screen. I’ve turned off all the superfluous transitions, so it appears almost instantly. In this case, you can see that I’ve just started working on a project in Textmate.
The pretty colors are courtesy of Ciarán’s SIMBL hack. I find it makes extensive use of OS X’s terminal much more visually pleasing.
There are three tabs. Since Visor essentially drops down an inline terminal window, the window has all of the functionality associated with a normal terminal window. In this case, I have three tabs, each with its own purpose.
I’ll get to the other two in a bit.
To switch between the tabs, you can use the standard Command-Shift-{ or Command-Shift-}. But if you install Ciarán’s tab switching SIMBL hack, you can also switch tabs via Command-1, Command-2, etc. a la Textmate or Firefox.
Textmate. I’m not going go into too many details about the plugins I use, as that’s covered amply elsewhere. Suffice to say that ReMate is a necessity if you do any kind of editing over network drives of dubious latency.
I use the IR_Black theme. I’ve used VibrantInk, among others, in the past, but settled on IR_Black as it provided just the right amount of vibrancy and muted austerity.
I do have my Textmate highlight color set to an eye-burning red, however. It’s too difficult to pinpoint the locations of find results, otherwise.
I work on a multitude of projects at various points during the day, and I’ve been too lazy to set up a proper hosts file to route Apache virtual hosts to the right folders. However, several of the projets are pure static templates, with only HTML, CSS and javascript. For those, I’ve found that using Python’s simple server works admirably.
I merely navigate to the directory in question, and start up the server.
The Python server sets itself up by default on port 8000. I usually have Firefox, Safari and a bunch of other browsers in a multitude of virtual machines for testing. When I’m doing my initial pass of the code, however, I tend to stay in Firefox.
The beauty of Visor is that it doesn’t steal focus. As such, I can switch back and forth between Textmat and Firefox via Command-Tab all day long. And then, whenever I need to do something with the terminal, I bring up Visor, do my thing, and then close it. All without interrupting my windows’ stack order.
With such easy access to the terminal, I’ve started doing things that I would normally do in the finder via the command line. A simple open /path/to/file will typically be much faster and accurate than opening up windows via the GUI. Using grep or find makes searching files simple, and I’ve actually stopped using Textmate’s git or svn bundles in favor of the command line executables.
You know what I really hate?
Pointless voice mails.
It was much more annoying before I got the iPhone, but even with visual voice mail, it’s still ridiculously aggravating. Every couple days or so, I’ll get a voice mail from someone, and it’ll say:
Hey David, this is XXXX. Call me back when you get this.
What the hell, people? I know you called me. I have a call log. I see my missed calls. But invariably, thinking it’s some sort of emergency or there’s some dire need, I call back. And it always goes like this:
Me: Hey XXXX, you called?
Person: Yeah, do you want to go grab dinner later tonight? Ask Michelle too.
Me: … Okay, sure. I’ll also check with her and let you know.
Why in the world couldn’t that have been in the voice mail? A voice mail like:
Hey David, this is XXXX, Do you and Michelle want to grab dinner later tonight? Let me know.
Contains so much more clarity.
So I leave with this question: would I be a super asshole and complete douche if I set my voice mail prompt to the following?
Hi, you’ve reached David. I’m not here right now. But I have a missed call log, and know that you called. If want to tell me why you called, leave a message.
Joe Grossberg at 06.12.2009
daeltar at 06.11.2009
dz at 06.06.2009
Ben Lowery at 06.06.2009
DASKAjA at 06.05.2009
dz at 06.01.2009
Tom at 06.01.2009
David A Teare at 05.31.2009
dz at 05.30.2009
T.J. Lahey at 05.30.2009
IR_Black in XCode at 05.29.2009
dz at 05.21.2009
Dru Kepple at 05.19.2009
Eric at 04.24.2009
Benny at 03.31.2009