Don't miss a post! Subscribe to my mailing list.
xclip for Ubuntu
Awhile back I wrote about pbcopy
for OS X. These days I find myself using Ubuntu quite often and missed having pbcopy
. Turns out there is a package called xclip that does the same thing on Ubuntu! Give it a try!
Rails Data Migration Results
When writing data migrations, it can be useful to know the number of records that were updated / created. If you run your migration in a Rails console, ActiveRecord will print out the database response object like this for PostgreSQL:
2.1.5 :008 >
OS X pbcopy
OS X has a nifty utility program named pbcopy
that I just learned about which can be used to copy things to the system clipboard.
For example:
cat foo.txt | pbcopy
or pbcopy < foo.txt
will copy the contents of foo.txt
onto the system clipboard.
Iceberg Classes and Inheritance
Better developers than I have written about iceberg classes and why they are a code smell. I’d like to talk about a specific kind of iceberg class I’ve recently come across. This type involves inheritance. Here’s an example of what I mean.
class Job
Database Tests with Rollbacks in Clojure
I recently purchased a beta version of Eric Normand’s Intro to clojure.test screencast. In it, he demonstrates how to use the use-fixtures
function to set up and tear down state for tests. The function can be used for :each
test run, or :once
. For...
Hoboken: A Sinatra Project Generator
I'm a huge fan of the Ruby web library, Sinatra. I think its biggest strength is that it allows me to structure my applications to fit the problem at hand, instead of trying to shoehorn my problem to fit a pre-determined structure.
A couple of years...
Setting Up Middleman with Jasmine
Currently, my favorite tool for generating static websites is Middleman. I recently wrote my version of the TodoMVC app using Middleman and KnockoutJS. I wanted to use Jasmine for my unit tests and had a little trouble setting it up. Here are the steps...
GitScore Parts 2 & 3
Here are parts 2 & 3 to the GitScore project. They are a follow-up to an earlier post. I originally intended the screencast to be two parts, but I had to split up part two so that I would be under the allowed YouTube length. I've also put the example...
Delegation in Python
At my current client, we use Python. The other day I needed to wrap a class from the requests library, specifically a response object. I wanted to add a couple of custom methods to the class and have the other methods delegate to the original object...
GitScore Part 1
UPDATE: Parts 2 & 3 are now done.
Recently I've been playing around with Screenflow, creating screencasts illustrating how I build Sinatra applications in Ruby. My goal was to create a few well-polished screencasts, but finding the time is hard. In...