Words & Deeds

Chase Giving Awards : 3 Days Left

Some of you haven’t voted yet! @Samasource is working to lift thousands of poor women and youth out of poverty by giving them life-changing work. We’re in the community builders category in this app: http://on.fb.me/Twv07H

Voting closes Dec. 4th. Don’t wait! Get your vote out now.

Learn more about our mission at http://lnkd.in/3QMeHp

Chase Giving Awards : Day 5

@Samasource is up for a $1 million grant at the American Giving Awards! Winners are selected by popular vote on FB this week only. If you believe that work is the answer for ending poverty, I would truly appreciate if you could take a moment to vote for us on FB via this link. You can vote until Dec. 4th at http://lnkd.in/qS7HJQ

 

Learn more about our mission at http://lnkd.in/3QMeHp

Chase Giving Awards : Day 4

@Samasource is up for a $1 million grant at the American Giving Awards! Winners are selected by popular vote on FB this week only. If you believe that work is the answer for ending poverty, I would truly appreciate if you could take a moment to vote for us on FB via this link. You can vote until Dec. 4th at http://lnkd.in/qS7HJQ

 

Learn more about our mission at http://lnkd.in/3QMeHp

Chase Giving Awards : Day 2

Day 2 of the Chase Giving Awards Voting: @Samasource is up for a $1 million grant at the American Giving Awards! Winners are selected by popular vote on FB this week only. If you believe that work is the answer for ending poverty, I would truly appreciate if you could take a moment to vote for us on FB via this link. You can vote up to once a day until Dec. 4th.http://lnkd.in/qS7HJQ Learn more about our mission at http://lnkd.in/3QMeHp

Run Arbitrary Tests in Rails

There are a lot of different ideas about how to run arbitrary tests in Rails (including autotest), but I’ve settled into using a Bash script. This script accepts either path arguments or regular expressions to specify which tests to run. It doesn’t “prepare” your test database, so if that is needed you should run rake db:test:prepare first.

Some added features:

  • starts up a Memcache server before the test suite is run, and shuts it down afterward
  • it sets up some environment variables for better performance when running in REE

And here’s the script:

https://gist.github.com/3352560

Mac OS/X Login/logout Hooks

We like to track and limit our kids’ time on the computer. In order to
help in this effort I wrote a couple of quick login and logout scripts
to track their time on our home computers. These scripts write their
information to a Mongo database running in http://mongohq.com and to
the Mac OS/X syslog.

I also have a web application that will read this data and display how
long each child has been on the computer for a given time period, and
what the events are for that time period.

So far, it’s working out nicely.

There was no real need to use Mongo for this, I could have used a
traditional RDBMS (e.g. MySQL, PostgreSQL, etc.), but Mongo was pretty
easy to do and I just like using it.

https://gist.github.com/2861733

Terminator

Terminator

I’ve switched to Terminator on Linux from Gnome Terminal. Mo’
features, mo’ shortcuts, mo’ better!

https://gist.github.com/1719840

You launch it like this: terminator -l 3term

:show_exceptions

I have a Sinatra app that wouldn’t show the exception backtrace in the log when an error occured. Obviously, it’s a bad idea to log backtraces, but in development/pre-production it can be really handy. It turns out that in my modular app, I needed to disable :show_exceptions. Once that was disabled I wouldn’t see the error page in my browser, but the side effect is that I get the backtrace available to me in my log. I didn’t expect such a side effect.

My actual code is something like this:

https://gist.github.com/1458091

Here’s a sample application that shows the behavior a bit better:

https://gist.github.com/1458108

If you remove “, :show_exceptions” from line 9 of app.rb you won’t get the backtrace in the log that is being logged at line 18 in the “error” block.