Emacs Major Mode: LESS CSS

| | Comments (0) | TrackBacks (0)

I'm a big fan of LESS, so naturally I decided to write an emacs major mode to support it. It's rather rudimentary at this point, but it's far better than working in fundamental-mode. If you're a user of both LESS and emacs, give it a shot and let me know what you think.

http://jdhuntington.com/emacs/less-css-mode.el

Emacs elisp snippet: jlh-join-lines

| | Comments (0) | TrackBacks (0)
I frequently find myself using join-lines in emacs (usually bound to C-x ^), which is a handy function that will merge a line with the line before it. A few times this week, I've found myself needing to join more than one line in this manner. Hitting C-x ^ multiple times is pretty tedious, so I wrote this quick bit of elisp to make this process faster. It's not complicated, but it does serve my goal of reminding myself that I should be writing elisp more often to make my life easier.
(defun jlh-join-lines (arg)
  "Join this line to the line above n times
Running this command with an argument of 1 is equivalent
to running 'delete-indentation (aka 'join-line)."
  (interactive "NHow many lines to join?: ")
  (while (> arg 0)
    (join-line)
    (setq arg (- arg 1))))
It occurred to me that there weren't enough wallpaper applications for the Android platform, so I decided to create another one. Mine is called "Wallpapr", a not too clever play on "Flickr", which is the source of all images available in the application.

What [hopefully] distinguishes this application is the workflow; "interesting" images are pulled from Flickr automatically and can be used as the system wallpaper with only two taps. A user's favorite photos are also readily available.

Adventures in home roastng

| | Comments (0)

For years, I've wanted to try my hand at roasting my own coffee. Hoping to do it cheaply, I've always been looking for a very specific type of popcorn popper that will work for this purpose. However, given the trend that popcorn poppers seem to have taken, I'd more or less given up on the idea.

A few months ago, Matt was kind enough to let me borrow his Fresh Roast Plus that he had since replaced. It's a great little roaster, and given what I now know, I'm glad this was the first roaster I've used. It does have its drawbacks, but it's a great roaster to learn on. Most notably, the build of the unit let me see what was happening to the beans throughout the roast, and also let me hear the audible cracks of the coffee beans. Now that I've done a little bit of roasting, I'm planning on moving up to a unit that can roast a half-pound or a full pound at a time. The Fresh Roast can accommodate only 3 ounces at a time, which means that to have fresh coffee consistently, one would have to roast nearly every day, depending on coffee consumption.

I started by ordering a sampler from Sweet Maria's, which gave me 8 different types of coffee to try roasting. I've liked them all, and it's amazing to taste the vast differences in flavor. Up until very recently, I had been letting beans sit for 12-24 after roasting before grinding and brewing, which I'm now realizing likely contributed to too much acidity. My most recent batch rested for about a week, and the flavor is much more apparent.

The roasting process itself is drop-dead simple. All it takes is putting the beans in the roaster, turning it on, then waiting for the appropriate signals to know when to stop. I used a guide from Sweet Maria's which has plenty of information on the roasting process.

I can tell I've got a ways to go before the beans rival those of my favorite local roaster, but they're a heck of a lot better than any of the national chains.


IMG_2768

Bugflow - A lighthouse/github workflow

| | Comments (0) | TrackBacks (0)

I love the integration between github and lighthouse. (If you're not familiar with this, have a look.) However, I always found myself forgetting which ticket I was working on when writing commit messages. At first, I wrote this script just to add the ticket number in the git commit message, but it quickly evolved to help throughout the workflow.

When starting on a new ticket, this script helps by

  • Assigning a ticket to when starting work
  • Creating a local branch with an intelligent name

On completion it will

  • Set the state of the ticket to a user-defined value (through the git commit msg)
  • Clear the active user (also through the git commit msg)

Workflow

Here’s an example of the workflow…

Setup

Install Bugflow

Just grab this script and put it wherever you like. (I prefer ~/bin)

Install Gem

Grab the lighthouse gem from github:

$ gem sources -a http://gems.github.com
$ sudo gem install Caged-lighthouse-api

Project Config

Finally, create a file in the root of your project called .bugflow.yml and add the following data:

Also, it’s a good idea to add this file to your .gitignore.

$ echo ".bugflow.yml" >> .gitignore

Happy hacking!

Emacs color theme: Blackboard

| | Comments (0)

After pairing with a coworker using Textmate's Blackboard theme, I decided I wanted it for emacs. The font lock I'm using in emacs for ruby didn't let me recreate it perfectly, but it's certainly close enough for me.

Here's my first crack at it: color-theme-blackboard.el

Update: Screenshot.

~/pprojects/autumn/libs/speciator.rb

A Different Kind of Experience

| | Comments (1) | TrackBacks (0)
Very few people like going to the doctor, myself included. So you can imagine my frustration when I found myself needing to making a doctor's appointment this week. I expected to have an appointment at an inconvenient time, sit in a stuffy waiting room with old magazines for an hour, only to be followed by sitting in a stuffy exam room for another hour. We've all been there.

Thankfully, I happened to look into Zoomcare's website, mostly on a whim. It sounded good, so I figured I'd make an appointment and see how it went. Turns out it went well. Very well. I made an appointment at 9:30am for 11am, and got an email back almost immediately that I was confirmed for said time. I showed up at 10:55am, waited for literally 1 minute, and left with a prescription in hand by 11:07am. 

They have earned themselves a happy new customer.

gem install punch for drop-dead easy time tracking

| | Comments (2)

While at cabooseconf last month, I found out about one of the coolest time tracking tools ever: punch. (Thanks to cardiod from OG)

According to its own description, it's a

k.i.s.s. tool for tracking the hours spent on various projects. it supports logging hours under a project name, adding notes about work done during that period, and several very simple reporting tools that operate over a window of time.

I find this to be a much easier method of tracking time than many alternatives, including the zillions of time tracking/billing web 2.0 sites. In fact, an hour or two of hacking could leave someone with a pretty decent time tracking AND invoicing tool.

And wouldn't ya know it, it's as simple as gem install punch.

OmniFocus Hack - the mobile list

| | Comments (0)

For those of you who use OmniFocus and won't be getting an iphone, this one could really come in handy. It's a ruby script that talks to OmniFocus via OSA, grabs all the items in a given context, then writes them as poorly-formed html over ssh to a predefined destination. Cheap and dirty, but it's the quickest way I've found to get stuff like this available anywhere, especially in a mobile phone browser.

#!/usr/bin/ruby

require 'rubygems'

require 'rbosa'

require 'net/ssh'

of = OSA.app 'OmniFocus'

shopping_list = of.default_document.contexts.collect { |x| x if x.name == 'Errands' }.compact.first.contexts.collect { |x| x if x.name == 'Shopping' }.compact.first

items = shopping_list.tasks.collect { |x| x.name unless x.completed? }.compact

def post_file( shell, file, datum )

shell.touch(file)

shell.send_command("echo \"#{datum}\" > #{file}")

end

def build_html(items)

"<ul>#{items.collect{|item| '<li>' + item + '</li>' }}</ul>"

end

Net::SSH.start( 'myserver.dreamhost.com' ) do |session|

shell = session.shell.sync

post_file shell, "~/shoppinglist.mydomain.com/index.html", build_html(items)

shell.exit

# session.loop

end


RailsConf and CabooseConf '08 Recap

| | Comments (0) | TrackBacks (0)
RailsConf 2008 is now over. It was a great conference, and here are a few of the highlights:

Avi Bryant demonstrated MagLev, a ruby vm written on top of the smalltalk gemstone architecture. Summary: Code and data in the global namespace of one ruby process is available in another ruby process. Oh, and if that's not enough, there's transactional memory too.

On the theme of distributed processing, there was a great demo of Skynet, a map/reduce style processing framework. The Rails plugin for skynet gives some great features with a slick API. For example, the 'distributed_find' for ActiveRecord models will let workers each handle a small slice of any given model.find and process the data accordingly.

David Chelimsky gave a great run through of what rSpec's story runner looks like, a tool which I'll be using as much as I can justify. Integration with webrat makes it even more useful, as now stories can be tested using the full rails stack.

The highlight of the weekend was hanging out with Phil and working on Bus Scheme. My first real pair-programming experience was hugely insightful, and now I've decided that it's essential that I find some time to work closely with some great programmers on a more regular basis. Aside from learning some excellent emacs tips (eshell, for instance), we got lots of TODOs knocked off and made some important structure changes in bus-scheme's AST.

Now I've just got to digest all the new code I've seen and the 20 new RSS feeds I now subscribe to.