Posted by Jeremy Hubert
Tue, 28 Mar 2006 21:32:24 GMT
Jake and I put the demo of MatchTag up on Sunday night at about 3am. Somewhat buggy and still a few things to hash out, but it works.
He made one post on a forum, and wouldn’t you know it.. there was 250 users signed up by the time I got back to Vancouver on Monday night.
Jake is keeping a running commentary on what it’s like to launch a product to people like this before it’s ready. If you’re interested, I suggest going over to his site and following along.
Also, please check out the demo and let us know what you think. :)
Posted in Rails | no comments
Posted by Jeremy Hubert
Tue, 21 Mar 2006 03:00:00 GMT
I put together a quick video for my friend Chad on how to get started with Locomotive. These are the standard steps I take for every new app I create on Locomotive.
Of course, I don’t create a notes scaffold for every one of them. ;)
I hope you find it useful.
Watch it Now
Cheers,
Jeremy
Posted in Rails | 1 comment
Posted by Jeremy Hubert
Sat, 04 Feb 2006 01:15:00 GMT
In the current app i’m working on, I wanted to store multiple values in a single column. I know, violation of the first normal form.. blah blah blah. Save it.
Anyway, I wanted to have a multiple select box that would easily allow me to Manage and update the attributes of the model. Here is my solution.
Create the database table
create_table :tshirt, :force => true do |t|
t.column :available_colors, :string
t.column :available_sizes, :string
end
Create the Model
class Tshirt < ActiveRecord::Base
serialize :available_colors, Array
serialize :available_sizes, Array
end
Create the YAML Options Hash
I use an options.yml file in the config directory to setup the options for the object. A containing hash is created using the name of the object, and then the sub-hashes match the name of the column.
./config/options.yml
tshirt:
available_colors:
1: Red
2: Blue
3: Green
available_sizes:
1: Small
2: Medium
3: Large
Load the Options File into the App
In your environment.rb file you have to load the YAML parser and then parse the options.yml file:
require 'yaml'
OPTIONS = YAML::load(File.open("#{RAILS_ROOT}/config/options.yml"))
The Select Box
This is the hard part.
module ActionView
module Helpers
module FormOptionsHelper
include ERB::Util
def serialized_multiple_select(object, method, choices = {}, options = {}, html_options = {})
html = []
html << "<select id=\"#{object}_#{method}\" name=\"#{object}[#{method}][]\" multiple=\"multiple\" size=\"5\">"
html << options_for_select(OPTIONS[object][method].invert,self.instance_variable_get('@'+object).send(method).collect{|x| x.to_i })
html << "</select>"
return html
end
end
end
end
Add the select box to your form
And this is the easy part:
<p><label for="tshirt_available_colors">Colors</label><br />
<%= serialized_multiple_select 'tshirt', 'available_colors' %></p>
<p><label for="tshirt_available_sizes">Sizes</label><br />
<%= serialized_multiple_select 'tshirt', 'available_sizes' %></p>
I am pretty sure there are better way to do this, but this one worked for me.
Also, my serialized_multiple_select has options that it doesn’t even use. I should really use them. Please offer feedback if you have any. :)
Posted in Programming, Ruby, Rails | no comments
Posted by Jeremy Hubert
Fri, 27 Jan 2006 20:06:00 GMT
The P.E.T.A (People for the Ethical Treatment of Animals) has gone and pushed the limits of shock marketing with their latest website Milk Gone Wild.
I’m not sure they really get the point across with the video, but I do know that I wouldn’t mind throwing a party like that on my own. :p
Posted in Scratch Pad | Tags marketing, milk, websites | no comments
Posted by Jeremy Hubert
Fri, 27 Jan 2006 19:31:00 GMT
“Spontaneous Me” sang Whitman and, in his innocence, let loose the hordes of uninspired scribblers who would one day confuse spontaneity with genius.
Excerpt from “The Elements of Style – Fourth Edition” Section 5.9
Posted in Scratch Pad | no comments
Posted by Jeremy Hubert
Tue, 24 Jan 2006 21:35:51 GMT
The Conservative Party in Canada is now running the country. I had a look over their Platform last night.
They want to add 5.3 billion to the current defense spending and recruit 23,000 more troops into the army.
People who support this tend to say “We don’t even have an army! We need an army!”
I disagree. What do we need an “Army” for? We don’t have any major enemies. No country is going to start a way with Canada and if for some absurd reason they did, we have Russia, England and the United States to back us up.
As far as protecting ourselves from a terrorist attack goes, no army is going to help that. Look at the states. The “best” army in the world. All they did was help cleanup the mess.
The only thing I see a Canadian army as being good for is Foreign Aid and helping the US fight it’s wars. Neither of which I’m all too happy to be paying more money for. We already do more than our fair share of foreign aid, in my opinion.
Having a Canadian army is as of about as much use as keeping a loaded gun in your house. There’s an off chance it may come in handy, but it’s much more likely that your kids will accidentally kill themselves.
Posted in Scratch Pad | 1 comment
Posted by Jeremy Hubert
Mon, 23 Jan 2006 11:36:00 GMT
We all have fears. Our lives are dictated by them. The fears that we express such as spiders and small spaces are easy to pin point. We let them out and, although they control us, we understand that and work around them. If we are unable to fly because of our fear of flying, we schedule trips that involve cars, trains and boats instead. We learn to tolerate this, as do those around us, and it becomes a part of our life.
The worst cause of fear is that people settle. They decide that what they have is ‘good enough’ because they do not want to put themselves through the pain of taking action. They choose fat over fit because of how hard it would be to get some exercise and to eat well. They stay in jobs they don’t like because of the fear that there is nothing else out there. They stay in relationships that they know aren’t right, just because fear of losing someone close doesn’t seem worth it.
Read more...
Posted in Life | Tags fear, honesty, pain, power, relationships, selfesteem | 1 comment
Posted by Jeremy Hubert
Wed, 11 Jan 2006 21:59:08 GMT
Finding a good place to go on vacation has always been hard for me. Like most people, I’m cheap when it comes to big purchases, and since I spent so much time in Maui when I was a kid, I don’t really subscribe to the idea of spending a few thousand dollars per person to relax on a beach.
I also don’t really have any restrictions on when I take a vacation, so all I’m really looking for is a good deal that I can snap up for a few days away… or a good price on a flight to somewhere that I can dissapear for a few weeks.
For those reasons, finding flights has always been hard. I don’t care about the flight dates. I don’t care about the destination. In fact, I don’t care which Airport I leave from – SEA (Seattle )is only an hour.5 away from YVR (Vancouver). All I want to do is say where I am, and have them tell me what my options are… and I want them to do it quickly and comprehensively. To be picky, I would also like them to tell me in Canadian Dollars so that I don’t have to convert it in my head.
Well wouldn’t you know it. The geniuses over at Kayak have gone and built the best flight search I have ever seen
. It does pretty much everything I would want it to do. It’s quick, it’s easy, and I can tell it my currency..
It sites like this that make me love the internet.
Thank you Kayak. :)
Posted in Travel | 2 comments
Posted by jhubert
Wed, 14 Dec 2005 16:51:00 GMT
I did something really stupid today. I deleted all of the .svn folders in my project before committing my changes, and after building a major addition to it. I was trying to delete them from another folder, and used the wrong terminal window. :|
Anyway, point being, I fixed it!
Here is what I did:
> pwd
~/Development/project_name/
> cd ..
> svn co http://svn.domain.com/repo/trunk/ project_name_temp/
> cd project_name_temp
> find . -type d -name ".svn" -exec mv -f '{}' ../project_name/log/.'{}' \;
find: ./app/.svn: No such file or directory
find: ./app/apis/.svn: No such file or directory
(repeated.. this is normal)
> cd ..
> rm -R project_name_temp/
The key was:
find . -type d -name ".svn" -exec mv -f '{}' ../project_name/log/.'{}' \;
Posted in Programming, OS X | 1 comment | no trackbacks
Posted by jhubert
Sun, 23 Oct 2005 21:49:01 GMT
RubyConf 2005 was held at the Hotel Layette in San Diego. I headed down with srbaker, Jerrett and the rest of the boys from Bravenet to spend 4 days geeking out with Ruby.
Highlights:
Meeting David Heinemeier Hansson (DHH). He met me too, he even says so himself: Watch The Video
Watching Matz talk about the future of Ruby, and seeing the community give instant feedback
Hacking away with Court3nay, KevinClark, Corp, Technoweenie, Bousquet, TopFunky and numerous other rails geeks developing the logingem and the plugin repository.
Having DHH come into our hackfest and listen to our ideas... and then buy!
Hitting "Rock Bottom" with corp, bousquet, court3nay and the boys.
Getting inspired with Jerrett, Ben and Steve at 2am on Sunday night... and coding until 4am the night before we're leaving.
Having drinks at the Irish Pub with the TextDrive team, and then moving downstairs to drink with DHH, Martin Fowler and the guys from Thought Works.
Many thanks to Steve Baker for the room and Ben for putting up with me as a roommate.
I was also very pleased to meet the following people:
- Bricolage
- Tobias!!
- Obie and Desi
- DireRed
- Schubert
- Defiler
- David Black
- Pretty much everyone else I met. Sorry if I've forgotten to mention you. :(
Photos of my trip
RailsConf Anyone?
Posted in Travel, Ruby, Rails | 4 comments | no trackbacks