The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Tuesday, May 20, 2008

Ruby on Rails Chron Job

This is just for reference RunnerScript

One option for running scheduled processes for a rails application.

see also HowToRunBackgroundJobsInRails

Monday, May 19, 2008

Free Rice

FreeRice.com

Just came across this site - a good idea and a great cause
Help end world hunger

From their website - http://www.freerice.com/about.html

FreeRice has two goals:

1. Provide English vocabulary to everyone for free.
2. Help end world hunger by providing rice to hungry people for free.

This is made possible by the sponsors who advertise on this site.

Sunday, May 18, 2008

MSSQL drop and re-add constraints

One of the guys at work hooked me up with this code - quite useful if you want to do a bunch of data inserts but don't want to worry about the order you apply the inserts because of foreign key constraints

Before performing data actions:
-- generate these and run
SELECT
'ALTER TABLE ' + so.NAME + ' NOCHECK CONSTRAINT ALL'
FROM sysobjects so
WHERE xtype = 'u'

After performing data actions:
-- generate these and run
SELECT
'ALTER TABLE ' + so.NAME + ' CHECK CONSTRAINT ALL'
FROM sysobjects so
WHERE xtype = 'u'

Thanks to ET for this code bit!

Wednesday, May 14, 2008

SnagIt promotional code (coupon) for $10 off

I have used SnagIt off and on over the past few years, usually with the trial version for a month here and there, finally broke down and got a license.
It runs $39.95 for single user - so I did a quick google search to see if any promotional codes were available and came across one - the promotional code SNUG will get you $10.00 off the standard price. The posting I found for this discount was from 2007 and it is now May 2008 so who knows how long it will be around?

SnagIt is a great tool - if you have never used it I recommend downloading the trial, best screen capture tool ever!

UPDATE 2009-01-07: the promo code SNUG expired on 2008-12-31, bummer; it was great while it lasted!

Saturday, May 10, 2008

Rolling Over Rails production.log file

Just came across this on a rails forum (post by Freezzo), rails production.log files can grow very large - but no chron job required - this is very handy.

config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 'daily')

where 'daily' can be 'daily' to 'weekly', 'monthly', '5mb', etc...

Python MVC web framework - web2py

Recently I did a google search for a Python MVC web framework. I have never done any coding in Python but it seems to be one of the primary languages used at Google and currently the only language supported on the Google App Engine so it seemed worth getting familiar with.

Django seems to be one of the most robust python mvc frameworks around at this time and I was going to dive in and create a small toy application with it, but then I stumbled across a comment on some blog that talked about the web2py MVC framework, still in it's infancy, development is very active on the project. It seems very easy to get up to speed with the framework and even someone who does not know Python can get a simple site up and running.

I love this graphic from one of the pdfs on the site

The feature list taken directly from the site
  • No installation, no configuration, no dependencies. All in one package. You can run it off a USB drive
  • Runs on Windows, OSX, Unix/Linux, and Windows CE phones.
  • Allows development, debugging, testing, deployment, maintenance and administration, including database administration, via the provided web interface.
  • Enforces good Software Engineer practices, like the Model-View-Controller design, validation and self-submission of forms.
  • Strong on security. Prevents the most common types of vulnerabilities: Cross Site Scripting, Injection Flaws, and Malicious File Execution.
  • Talks HTML, XML, RSS, ATOM, AJAX, JSON, RTF, CSV, WIKI, XML-RPC, REST, Flash, etc.
  • Dynamically and transparently generates SQL queries for you for SQLite, MySQL, PostgreSQL and Oracle. Even creates and alters tables for you when required. Performs automatic transactions.
  • Allows you to create apps easily, byte-code compile them, and distribute them in open or closed source under any license you like.
  • Faster then the competition, designed for small as well as large projects, includes the ability to upload/download/stream large files, internationalization support, distributed transactions, ...
Web2py is worth checking out!

.

Saturday, May 3, 2008

Komodo Edit - new text editor of choice for Ruby on Rails

Komodo Edit is my new text editor of choice for ruby and rails stuff. I use windows OS and have tried alot of different editors and IDEs; most of the IDE are too slow for my tastes and I have been using an alpha version of InType or NotePad++ for any Rails development.

This product is free and available from ActiveState. Note that there is also Komodo IDE which is a full blown IDE and is not free. I have not tested out that product but may in the future.

Go to http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml click the 'Get Komodo Edit' button, ignore the contact details form, it is optional and kind of annoying? Click Continue to download, there are versions for Mac, Linux and Windows.

After installing the MSI package I only needed to make a few minor tweaks to my preferences
First things first, create a new 'Project' (File -> New -> New Project), just point to one of my existing rails applications and save the kpf file in the root. Then I actually want to see the files so View -> Tabs -> Projects


And a few tweaks; get rid of that right hand edge line, not a big fan. Edit -> Preferences -> Smart Editing -> uncheck 'Show edge line / Hightlight characters beyond...' ok - i have been converted to the dark side so, Edit - Preferences -> Fonts and Colors -> select Dark from the Scheme, bump the font size to 12 and go bold - you will be prompted to give this new scheme a name


bada bing bada boom - we are good to go