MetaSkills.net

Quickie.js - Prototype wrapper for QuickTime

Posted On: January 24th, 2010 by kencollins

As some of you know, I am in the last steps of announcing my first iPhone application. We all know that every good iPhone application has a great marketing website with a screen cast. I myself was heavily inspired by the Tapbots Convertbot website while building my own and wanted a good way of embedding the screen cast. I think the last time I did an object/embed tag was god... around 2003 or something, seriously.

Rails Button Links In Embedded Forms

Posted On: January 5th, 2010 by kencollins

This is one I have had sitting around for almost 3 years now in my toolbox and thought I would share. Have you ever had complicated rails forms and needed simple form buttons that just took you to a simple link? Were you bitten by the button_to helper code because it generates another form inside of a form? If so, here is a simple rails view helper I made that creates simple button links for embedded forms by making an input with a javascript function. Tag soup you ask, hell yeah, but worth if if you need it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

def button_to_link(name, link, options={})
  confirm_option = options.delete(:confirm)
  popup_option = options.delete(:popup)
  link_function = popup_option ? redirect_function(link,:new_window => true) : redirect_function(link)
  link_function = "if (confirm('#{escape_javascript(confirm_option)}')) { #{link_function}; }" if confirm_option
  button_to_function name, link_function, options
end

def redirect_function(location, options={})
  location = location.is_a?(String) ? location : url_for(location)
  if options[:new_window]
    %|window.open('#{location}')|
  else
    %|{window.location.href='#{location}'}|
  end
end
Tags: form, rails, ruby

Authenticated S3 GETs For Private Objects Using Paperclip

Posted On: November 23rd, 2009 by kencollins

Yea I know, I am probably the last person on earth that is just getting around to using Paperclip. To be honest, most of my file upload code was written way before Paperclip or even AttachementFu was ever conceived. And frankly, I do not do much social app coding on the side - so the need never came up. But that changed recently and I wanted a really really good way of leveraging AWS::S3 storage with the best local app security while maintaining tight control over the files.

Tags: paperclip, rails, ruby, s3

Meta Programming In...

Posted On: November 11th, 2009 by kencollins

Last nights 757.rb meeting was a great success. We did a talk titled Introduction To Ruby & Rails for all the new comers that might have been interested in learning more about both – from the ground up. Since Ruby was my first language and my toolbelt only extends to JavaScript and Objective-C, I'm always interested in how other languages do the things that I love so much in Ruby. One of the biggest pluses for Ruby, to me, is the support for meta programming. In a typical rails model, you might see something like this.

Tags:

Installing REE With The Snow Leopard SQL Server Stack

Posted On: October 27th, 2009 by kencollins

Today I noticed that Ruby Enterprise Edition 2009.10 was released and I have really been wanting to see if I could get the SQL Server adapter tested and running under it. I am really curious how the speed improvements might look and will share my results below. This article assumes that you read my previous guide titled The Ultimate OS X Snow Leopard Stack For Rails Development - x86_64, MacPorts, Ruby 1.8/1.9, SQL Server, SQLite3, MySQL & More as I will be building on top of it and referencing certain steps. So let's get down to business.

Tags: ree, ruby, sqlserver

The Zombie Shotgun Revisited

Posted On: October 10th, 2009 by kencollins
Resident Evil Zombie Shotgun

My how time flies. Over a year ago I created a simple bit of code that was useful for stopping ActionController routing errors from common Microsoft attacks from sending exception notification emails. Well now most people do not use exception notifications emails in favor of apps like Hoptoad. And hey, most code like this has moved to Rack middlewares.

Yesterday I noticed a rack code competition that encouraged "most useful and top quality Rack middlewares". Well the Zombie Shotgun is pretty useful to me, but I'm sure it's not top quality. That said, I did take the time to finally pick up on the rack internals and learn how to use rack-test. If you want to check out the new tested Zombie Shotgun middleware and how I tested it using Shoulda, go see the project on my github page. Also, here is my CodeRack entry.

Tags: middleware, rack, ruby

757 Studio

Posted On: October 4th, 2009 by kencollins
757 Studio Website

Well it took up quite a bit of my free time and a good 2 weeks of no iPhone development, but I am very very happy that the organization of my first event has been a success so far. Check out 757studio.org for full details. Andy Hunt is headlining the event with a talk on Pragmatic Thinking and Learning. Clinton Nixon and Jamie Pinkham will be following with talks on Ruby/Rails and iPhone/Cocoa. So even though I can not make it to the West Coast for RubyConf this year, it is not so bad with a local event like this.

Tags: 757, cocoa, objc, rails, ruby, studio