February 2012
2 posts
Switch heroku accounts in the console
1. Delete the SSH keys from your current account:
$ heroku keys:clear
You have to clear these first because Heroku won’t allow two accounts to have the same SSH key.
2. Delete your locally stored credentials:
$ rm ~/.heroku/credentials
3. Re-enter your (new) credentials by entering any command that requires access to an account, e.g.:
$ heroku create
Enter your Heroku credentials.
Email:...
Easily Sync Google Calendars to your iPhone →
So many places i’ve looked make this a very difficult process. The above link is almost too easy.
May 2011
1 post
Mac Bash / Shell Script To Launch Development...
As my rails apps get more complex, I find myself spending more time getting them booted up. While this may not be a big deal for you, my early morning brain doesn’t do well with it.
After a bit of searching I found some code for launching rails server in a new terminal tab, opening text mate, launching delayed job in a new terminal tab, and opening the browser.
I put this in a file called...
February 2011
0 posts
Colorado Girls Come to Town →
Cast: Nathan Colgate
January 2011
3 posts
Drag and Drop Paths in Raphael JS
The key here is to convert the x and y deltas into translate values, which the path object understands.
jQuery(function () {
var startPath = function () {
// path coordinates are best kept as relative distances
// so that you can use the built in translate method
this.ox = 0;
this.oy = 0;
},
movePath = function (dx, dy) {
// move is called with dx and dy, which we...
Giant Letter Creator →
Handy little flex / flash app that generates giant ASCII text. Great for commenting code.
October 2010
1 post
Simulating PROPFIND Request Using Curl on Rails...
curl —data “<xml></xml>” —header “Content-Type: text/xml” —request PROPFIND localhost:3000/one/two/three
September 2010
4 posts
PostgreSQL GUI →
Lessons Learned PostgreSQL on Mac OS X
Like many Rails shops out there, we are moving all our servers into the cloud. A few legacy projects, and certainly all new ones. Our cloud of choice: Heroku. I’ve been a Heroku fan since the first time I tried deploying an app on their system… and it just worked. They’ve been a fantastic solution, with almost no hiccups, until this past week when I ran into problems with the...
PostgreSQL on Mac OS X →
v8.3.11
Debug IE JavaScript →
For future reference.
August 2010
1 post
What Version of Flash Am I Using? →
I seem to be referencing this frequently
June 2010
1 post
mProjector 4 Windows Fixes
We’re a mac shop. Anytime we have to go back to a PC, I’m not a fan. These are notes for any future development, and if you can get use out of them: great.
Problem 1) We couldn’t get our mProjector apps to run on a PC. They would compile, but not run. And not even give the nice “Please go download adobe flash player” messages. We were getting the full blown...
May 2010
1 post
S3 SWF Upload Gem for Rails 3 →
github.com/nathancolgate/s3-swf-upload-plugin
The good stuff starts around 7:30!
S3SwfUpload allows user to upload a file to S3 directly, so you can save the cost of uploading process…
April 2010
1 post
Rails 3 ActionMailer and Delayed Job
What I’d like to do:
message = Notifier.password_reset_instructions(self) Delayed::Job.enqueue MailerJob.new(message)
What happens when I do:
TypeError in Public/password resetsController#create can’t dump anonymous class Class … /lib/delayed/backend/base.rb:61:in `payload_object=’
Problem line 61:
self[‘handler’] = object.to_yaml
Console confirms:
...
March 2010
2 posts
Stephenson Intro Video →
Cast: Nathan Colgate
January 2010
1 post
How to Rename a File on S3 with right_aws and Keep...
Because this took way too much time to figure out:
s3=RightAws::S3Interface.new(S3SwfUpload::S3Config.access_key_id, S3SwfUpload::S3Config.secret_access_key)
old_name = "tmp/#{self.video_file_name}"
new_name = original_video_file_path
bucket = S3SwfUpload::S3Config.bucket
(1..5).each do |try|
begin
acl_prop = s3.get_acl(bucket, old_name)
s3.rename(bucket, old_name, new_name)
...
October 2009
1 post
September 2009
3 posts
Dealing with Exception Notifier and Rails 2.3.3
I installed Exception Notifier on one of our Apps running Rails 2.3.3 and kept running into this error:
Net::SMTPFatalError (555 5.5.2 Syntax error..
A little bit of insight provided this heads up:
But as of Rails 2.3.3, the from email address will get the angle brackets added, so it can only contain the address.
Rails 2.3.4 is/was supposed to fix that, and includes tests so it will be ensured...
Adding Email and User Verification to AuthLogic
The Session
class UserSession < Authlogic::Session::Base validate :check_if_verified private def check_if_verified errors.add(:base, "You have not yet verified your account") unless attempted_record && attempted_record.verified end end
The Migration
class AddVerifiedToUser < ActiveRecord::Migration def self.up add_column :users, :verified, :boolean, :default...
Flickering Vizio HD LCD TV →
Use Case Scenario: Watching movies on the TV via my Laptop. MacBook with Mini-DV to RGB adapter. RGB and 1/8” stereo headphone jack run to back of TV. Input: RGB. After about 15 minutes of…
August 2009
2 posts
Custom Generators That Work in all of your Rails...
Go here:
/Library/Ruby/Gems/1.8/gems/rails-X.X.X/lib/rails_generator/generators/components/
Trouble with Deprec Setting up Apache and...
I was getting this error a lot:
VirtualHost *:80 — mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
The fix:
I had to remove the default site:
cd /etc/apache2/sites-enabled/
sudo rm 000-default
The file is still available here:
/etc/apache2/sites-available/
But is not conflicting with the config files that deprec sets...
April 2009
3 posts
Update to YUI Editor Code View Problem
I over complicated things in my previous solution, and found a better solution while trying to get the WYSIWYG editor to work inside an AJAX form using rails’ remote_form_for.
Using the YUI editor example, set handleSubmit to false and add this right after the MyEditor.render();
// Nate's better Handle Submit
function myHandleFormSubmit(e){
if(state == 'off') {
...
Trying to use the YUI WYSIWYG RTE as a code editor
Our CityGates app uses the YUI WYSIWYG Rich Text Editor to for all large text areas. Unfortunately, it does not have code / source editing support out of the box. To implement it, you must use some custom code to toggle the textarea / WYSIWYG visibility.
The example from YUI does not use handleSubmit. This means that when a user submits the form from the WYSIWYG editor the textarea does not get...
jQuery Cycle Different Effects for Previous and...
jQuery Cycle plugin is fantastic. However, there is a little bit of inconsistantcy when using it as a left/right slideshow. You click the next arrow, it goes right. You click the previous arrow, it goes left right. The following code allows you to have different effects based on previous/ next button clicks.
Demo
jQuery(document).ready(function(){
$('#blink_headlines').cycle({
fx:...
January 2009
1 post
My Dreams Concern Me
Nathan: Why are you here?
German1: We're looking for Marius Deboucher.
Nathan: Who?
German2: Marius Deboucher. You know. The chess player.
Nathan: ...
German1: Marius Deboucher, the greatest offensive castling chess player in the world!
Nathan: I'm afraid not.
German1 and German2: (singing a jingle) "Knight to check. Rook to Queen's pawn six. Checkmate. You've been Marius Debouched!"
Nathan: ...
December 2008
1 post
Prototype AutoSelect with Category Subdivision →
Proof of Concept
Cast: Nathan Colgate
November 2008
1 post
TinyMCE ImageManager and Symbolic Links
Solved: If using capistrano and you have a symlinked shared directory which exists between deployments. set preview.wwwroot to /var/www/apps/application/shared/ and filesystem.rootpath to /var/www/apps/application/shared/system (assuming you want to save files in system). This avoids the symlinks and allows tinymce to translate the paths properly.
-via pyrat
October 2008
2 posts
nathancolgate: Currently not a fan of the lack of... →
September 2008
3 posts
August 2008
3 posts
July 2008
2 posts
June 2008
5 posts
Konami Code
Matt told me about the Konami Code in Google Reader.
Pure awesome.
Nice BackgroundRb.yml Config File
Here is a handy configuration to easily run BackgroundRb in both development and production environments without having to worry about multiple backgroundrb.yml files:
:backgroundrb:
:ip: 0.0.0.0
:port: 11111 # use port 11111
:production:
:backgroundrb:
:port: 22222 # use port 22222
:lazy_load: true # do not load models eagerly
:debug_log: false # disable log workers and...
Pirates DVD Menu →
Pirates DVD Menu from Nathan Colgate on Vimeo. Nothing too fancy. The scene selections are broken down by each song. Cast: Nathan Colgate
May 2008
21 posts
Happy Birthday! You have lyme disease.
– My Doctor, upon inspecting the tick bite on my leg from last weekend.
The Unlucky Witch →
The Unlucky Witch from Nathan Colgate on Vimeo. A Cooper Movie! Cast: Nathan Colgate
Doug and Nate Blow Stuff Up →
Doug and Nate Blow Stuff Up from Nathan Colgate on Vimeo. From the archives. I wish I had this at higher resolution, but you get the idea just the same. Cast: …
Pirates of Penzance Teaser →
Pirates of Penzance Teaser from Nathan Colgate on Vimeo. It’s coming. Pirates on DVD. Let me know if you would like a copy. They’ll probably be about $20. Cast: …