Exception handling is great, but is it always the best thing to do? http://effectif.com/ruby/cost-of-exception-handling
Ruby
- RubyFlow
-
Benchmarking Ruby exception handling
6 Nov 2009 | 4:36 am -
How to keep your stylesheets clean and organized using Rails (Tutorial)
6 Nov 2009 | 3:01 amstyled_objects is a Rails plugin for simplifying stylesheet management on your application. Check out this tutorial that guides you through building a web application from scratch using Rails with the styled_objects plugin. -
Rubyists.EU: Stairway to the European Ruby Community Integration
6 Nov 2009 | 12:38 amRubyists.EU is a free of charge communications platform, which aims at encouraging better communications among Ruby communities and individual Ruby enthusiasts across Europe. -
Latest GitHub gem released
5 Nov 2009 | 5:33 pmNow available on gemcutter, the github gem is alive and kicking with an exciting 0.4.0 release. To install: $ gem sources -a http://gemcutter.org $ gem install github To see all the options: $ gh Post any issues/bugs. Latest continuous integration status via runcoderun: green. -
Scaling Rails – On The Edge – Part 1
5 Nov 2009 | 3:10 pmGregg Pollack has released a new episode in his Scaling Rails series. This is the part 1 of 3 screencasts scheduled to release in the near future. In the first of these, Gregg introduces three tools: Bullet, Rails Indexes and Scrooge. Check out the blog post or download the episode.
- The ADS Blog
-
Employees Are People, Not Resources
6 Nov 2009 | 6:33 pmWhen you see employees as people rather than resources, your view on what information they should have access to changes, and the barriers to communication can be broken down. -
Managing Agile Projects is Now Easier with Scrum’d
5 Nov 2009 | 6:30 amWe’re happy to announce that we are live with a huge update to scrum’d. We took in all the feedback from our users, and after having used scrum’d ourselves for a number of months, we knew there were some things that needed changing. So, here’s all the goodies in this update. Product Backlog The first thing we did is move the product backlog to it’s own tab. With the product backlog being located on the project planning page, it was too small to work with, especially for larger projects. Also, we made the expand and collapse links show and hide the acceptance… -
New Business Manifesto
3 Nov 2009 | 9:58 amWith trust broken, employees seen as resources, and customers viewed as invoices, business is broken. Social media has given the consumer a much louder voice, who is demanding a new way of being from business. It is time for a new business manifesto. -
Make Your Blog More Social In 3 Easy Steps
2 Nov 2009 | 7:06 pmHere’s how you can make your blog more social in 3 easy steps. I hope that everyone that has a blog follows these and makes it easier for everyone to keep up to date with their blog. Step 1: Use Disqus or another social commenting system. If you use WordPress, there’s a plugin for that. The great thing about Disqus is that I automatically get emailed comments on posts I’ve commented on. If you don’t go with Disqus, at least add something that allows readers to subscribe to follow-up comments. And yes, you guessed it, there’s a WordPress plugin for that. Step 2:… -
Remember What’s Important
2 Nov 2009 | 6:30 amIn the fast paced world of a continuous flood of information – Twitter, Facebook, and more – take time out to remember what’s important.
- Ruby Inside
-
Jekyll: A Ruby-Powered Static Site Generator
5 Nov 2009 | 1:34 pmJekyll is a simple Ruby-powered static site generator, originally by Tom Preston-Werner (aka mojombo) of Github fame. It's focused around blogging, but it can be configured to generate any kind of static site. (Note: Jekyll has been around for about a year - Tom originally blogged about it in November last year, so apologies if this is old news to some readers, but I've only recently discovered it!) Because Jekyll outputs a static site structure, it means you can host your blog (or site) from anywhere that you can serve static HTML, simply by using your favourite web server (e.g. Apache). As… -
Thinking Functionally In Ruby – A Great Presentation by Tom Stuart
3 Nov 2009 | 6:04 amThinking Functionally in Ruby is a talk that British Ruby developer Tom Stuart gave at a recent London Ruby Users Group meeting. In it he covers what functional programming is, why it's a "pretty neat idea," and how to adopt functional programming principles in Ruby. Skills Matter took a video of the entire 47 minute presentation (it's embedded on the right hand side of that page - Flash required.. just been told it might be limited to UK visitors only, if so get the original MP4 file) but there's also a 110 page PDF (1.5MB download) you should have to hand too (with Tom's slides). I don't… -
Riot: for fast, expressive and focused unit tests
31 Oct 2009 | 9:57 amRiot is a new Ruby test framework by Justin Knowlden that focuses on faster testing. Justin was frustrated with his slow running test suites, despite employing techniques such as using factories, mocks and avoiding database access. He realized that a slow-running suite makes one reluctant to run it or expand it - not good. With Riot, each test consists of a block which forms a single assertion on the topic of the test, keeping the tests focused. Tests run in a specific context, and the setup code is only run once per context, further contributing to the speed of your test suite, and unlike… -
Heroku Gets Add-Ons: Serious Ruby Webapp Hosting Made Easy
28 Oct 2009 | 8:33 amHeroku is a Ruby webapp hosting service that we first mentioned about two years ago. It started off as an online IDE of sorts, but is now a complete cloud platform for running Ruby webapps. You can develop locally and then, with a single command, deploy your app to their metered service. Well, Heroku got in touch with me last week to talk about their new "Add-Ons" feature and they've really kicked things up a notch for people wanting to quickly roll out webapps online. Till now, Heroku has provided basic functionality on a semi-metered basis. You pay a monthly fee for a basic rate of service… -
Gemcutter Is The New Official Default RubyGem Host
26 Oct 2009 | 4:48 pmJust two months ago we posted about Gemcutter, a new RubyGem hosting repository that, we said, was "taking aim at RubyForge and GitHub." It only took six weeks for GitHub to give up on building gems and to start recommending Gemcutter instead. Today, RubyForge is toppled also. Gemcutter developer Nick Quaranto has announced that Ruby Central has given the thumbs up to replacing http://gems.rubyforge.org/ with http://rubygems.org/ (the new Gemcutter URL) as the default gem host in RubyGems. The transition from RubyForge to Gemcutter/RubyGems.org isn't an overnight deal and gem publishing from…
- Railscasts
-
Episode 186: Pickle with Cucumber
2 Nov 2009 | 12:00 amPickle adds many convenient Cucumber steps for generating models. Also learn about table diffs in this episode. -
Episode 185: Formtastic Part 2
26 Oct 2009 | 12:00 amLearn about some of the more advanced functionality of Formtastic including handling many-to-many associations, required fields, and styling. -
Episode 184: Formtastic Part 1
19 Oct 2009 | 12:00 amFormtastic is a concise way to generate form views. In this episode (part 1 of 2) I show how to generate both a simple form and a more complex one which is customized with options. -
Episode 183: Gemcutter & Jeweler
12 Oct 2009 | 12:00 amGemcutter is a new service for hosting RubyGems, and Jeweler provides an automated way to release versions of a gem. -
Episode 182: Cropping Images
5 Oct 2009 | 12:00 amPresent a slick user interface for cropping image attachments using Jcrop and Paperclip.
- Hivelogic
-
DoesFollow Adds Twitter List Support
5 Nov 2009 | 4:29 amIf you’ve ever wanted to know if somebody is following you on Twitter, you could find out by using the handy DoesFollow service. A recent update brings support for Twitter’s new list capabilities, allowing you to check list membership as well. [Permalink] -
Sitting, Standing, and Bouncing
3 Nov 2009 | 6:07 amIn my interview on The Setup (and subsequently on Twitter), I mentioned that I often stand while working, and that when sitting, I usually use a balance ball. To my surprise, a lot of people have contacted me wanting to know more about it. Rather than answer everybody individually, I thought I’d share the information here. Why work standing up or on a balance ball? I began working standing up a few years ago to help alleviate a back issue I was having, caused primarily from sitting too long with bad posture in an unsuitable chair. Sure I was in decent shape, stretching, and running 3.5k… -
Dr. Weil: The Moral Ferocity of “Eating Animals”
29 Oct 2009 | 5:05 amLots of people from both sides are talking about Jonathan Safran Foer’s new book, Eating Animals, but I think Dr. Andrew Weil’s piece in the Huffington Post is worth a read. But if you still eat meat from factories […] you have not, by definition, absorbed the reality of factory farms. If you truly understood the nightmarish brutality of what happens inside these windowless animal jails and abattoirs that dot the American ruralscape, you simply would not eat this meat. Foer makes it clear that factory farming is the exceptional human activity that debases and destroys… -
The Talk Show Episode 30: Commitments
29 Oct 2009 | 2:36 amIn Episode 30 of the world’s best podcast, John Gruber and I talk about Droid, iPhone, Apple’s new desktop hardware, and more. [Permalink] -
EE Podcast Episode 5: EE 2.0 and the EllisLab CTO
28 Oct 2009 | 3:42 amIn episode 5 of the EE Podcast, Ryan Irelan and I talk about the EECI 2009 conference, EE 2.0, and talk tech with EllisLab CTO Derek Jones. The EE Podcast is now also available in iTunes. [Permalink]
- Dr Nic
-
Hacking someone’s gem with github and gemcutter
3 Nov 2009 | 10:44 pmEver used a rubygem, found a bug, and just wanted to quickly bust out the big guns and fix it quickly? The gem command doesn’t come packed with a way to find the original source repository for a gem. At best, most gems at least come bundled with the complete source, tests and documentation. Some gems don’t. Fair enough, since having access to the complete source via the gem still doesn’t allow you to fix a bug and share it with the world. For that you access to the repo, a quick way to fork it, and a post-github way to share a gem version from yours truly. The github gem and… -
First look at rails 3.0.pre
2 Nov 2009 | 8:05 pmThis article is out of date in some aspects. See comments. Today I had my first look at rails 3.0.pre and below are the sequence of steps I had to take to create a rails 3.0.pre application, and get it’s generators to work. Why was I looking at the top-secret, yet open-source Rails 3.0? Their generators are being migrated over to Thor and I wanted to see them in action. I was thinking I might migrate newgem to use Thor too. Here’s a quick poke around of getting started and interesting things I found. Any hiccups and workarounds are meant as a guide to pre-pre-3.0 users/developers… -
During integration tests you might want to load public/ files
9 Oct 2009 | 2:46 pmI’ve been wondering recently “If I cache a file in public/ how do my integration tests access the file?” By default, Rails’ integration stack only calls into the routes/controllers. So the following fails, ironically with a 404 error: $ script/console >> app.get '404.html' => 404 It should return 200. If I cache a file into public/ I want to be able to pull it back out during the normal course of integration testing. In integration testing, this problem manifested when I clicked a link to a cached asset, or an action redirected to a cached asset. Ryan Tomayko… -
Rails themes can remember things
7 Oct 2009 | 4:23 amI was getting annoyed at having to remember all the csspath/xpath expressions for a theme I reused in a new project. So, install_theme now helps each theme folder remember the previously used settings. gem install install_theme # version 0.7.0+ install_theme path/to/rails_app path/to/template #content_box \ --partial "header:#header h2" \ --partial sidebar:#sidebar" Now, the next time you apply that same theme to another project you don’t need to mention “#content_box” or use the --partial flags: install_theme path/to/another_rails_app path/to/template How? If you squint… -
hash bang cucumber
6 Oct 2009 | 9:37 pmI don’t know if this is a good idea or not, but often I just wish I could copy and paste a cucumber feature file into the command line and have it just run the frigging scenarios without having to prefix it with “cucumber”. Perhaps I’m a bit delirious but I think it would be fun to paste features/112_users_crud.feature into the console and it would run the scenarios: $ features/users_crud.feature instead of having to always do the extra key strokes: $ cucumber features/users_crud.feature Solution? Two steps: At the very top of each feature file add: #!/usr/bin/env…
- techno weenie - Home
-
Structuring your background jobs
This morning while dealing with a support issue, I asked this question on the twitters: Do you create a single (background) job for an event (AfterPostUpdated), or multiple jobs for tasks (SendPostEmails, UpdatePostCounts)? In Tender Support, updating a discussion spawned a job that looked something like this: class Job::CommentNotifications < Job::Base.new(:comment_id) def comment @comment ||= Comment.find comment_id end def perform comment.notified_users.each do |user| UserMailer.deliver_notification(user, comment) end end end (In case Evan asks, I am referring to a secret military Base… -
New to the CAN: Widget, json fixes, etc
I just pushed a new version the Calendar About Nothing: mtah fixed a problem with the JSON routes. Gah, totally my fault. jqr cleaned things up a little, patching broken windows, etc. One really nice thing: he fixed a potential infinite loop in feed processing. Kalin Harvey added a capfile. kastner. And the big update: lachlanhardy wrote a jQuery widget so you can post the calendar to your site. Thanks for the updates, everyone. Also, I’ve been working with the Heroku guys on getting the weird intermittent server error on IsLOSTOnYet up and running. I think it’s fixed now. -
poetic tweets
Saul Williams’ trek through the midwest between shows sparked some musings on Twitter. Driving from Denver to Kansas City. My mind travels at a faster pace than my body. I mark my way with words. If the newest technology enhances transparancy then this is an ideal time to share your process. Share how your mind works. How do you think? Do u associate w/negative thoughts and ideas? Are u cynical? What do u profess? What would u proclaim? Are you more concerned with like-minded agreement? Are you a naysayer? Perhaps, like me, you raise questions… But who am I fooling? is this viral voice my… -
WTF does that cron do?
I’ll be the first to admit that I’m not a great system administrator. I was a windows guy for so long, so my only exposure to linux was haggling with shared hosting accounts to run my stupid php apps. While my linux/administration skills have grown by leaps and bounds in the last few years, I still get caught up on something as simple as cron jobs. The syntax is very terse, and probably easy to parse for computers. For the rest of us… Well, what the hell does this mean? */6 * * * * rake ts:index:delta According to my new project, CronWTF, that “runs rake ts:index:delta at minutes :00,… -
How to get hired by ENTP
At ActiveReload, our question was “How good are you at Gears of War?” Will qualified with flying colors (he was 100th in the world). Last year as ENTP was starting, it was “How good are you at Rock Band?” Towski impressed us with his killer Chris Cornell impersonation. Now, we’re looking for that person with elite Korg Kaossilator experience. Is that someone out there?
- RailsTips - Home
-
Know When to Fold 'Em
3 Nov 2009 | 4:22 pmIn which I relinquish the day to day maintenance of a few of my projects. I have a lot of projects. Each time I feel pain or inspiration, I’ll whip together a new library and release it as a gem. It is fun and I love it. It is even more fun when people come along and use those projects to do cool stuff. This in turn, inspires me to write more code and release more projects. It is a vicious cycle. A while back, I caught myself making jokes about how I don’t even use my projects. I can barely remember the last time I actually used HTTParty, HappyMapper, or the Twitter gem. Not too long ago,… -
More MongoMapper Awesomeness
9 Oct 2009 | 6:46 amIn which I dish on the latest MongoMapper features like dirty attributes, time zone support, custom data types and dynamic finders. September was a month of craziness and for the first month in quite a while I did not post here. I promise it hurt me as much as it hurt you. In an effort to get back in the rhythm, I am going to start with an easy article. MongoMapper has been getting a lot of love lately and I thought I would mention some of the awesomeness. Dynamic Finders Dynamic finders are so darn handy in ActiveRecord. How many times have you used User.find_by_email and the like? -
Lookin' on Up...To the East Side
20 Aug 2009 | 7:10 amIn which I provide an enormous amount of examples to explain Ruby’s method lookup path. I am currently reading the Well-Grounded Rubyist by David Black. It is a great book and reading it reminds me of things I was confused on when I started in Ruby. One of those things was the path Ruby uses to figure out which method to call when inheritance and mixins are in play. As I read it last night, I thought I should post about it, so here it goes. Let’s start with a simple class. class A def foo puts 'foo in A' end end A.new.foo # foo in A Inheritance That was pretty straightforward. Next up… -
MongoMapper Indy.rb Presentation
19 Aug 2009 | 8:08 amIn which I post slides and audio from my last MongoDB presentation. Last Wednesday I was invited to present on MongoDB and MongoMapper at the Indianapolis ruby group. I promised them I would post the slides so they could get to the links and such. Slides The slides are very similar to my Grand Rapids presentation on MongoDB. but the actual talk was different. <object height="355" width="425"><param /><param /><param /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mongodbindyrb-090819100052-phpapp01&stripped_title=mongodb-indyrb" height="355"… -
Patterns Are Not Scary: Method Missing Proxy
6 Aug 2009 | 7:50 pmIn which I show how to create a method missing proxy and provide some example uses in the wild. Method missing proxy? Ooooh! Sounds scary, right? I got news for you Walter Cronkite, it’s not. Lets start with the definition of proxy, according to Wikipedia. Definition A proxy, in its most general form, is a class functioning as an interface to something else. An interface to something else. That sounds easy enough. You might be thinking that you have never used a proxy, but if you are reading this blog, you are wrong. Chances are you have used Rails, and if you have used Rails, chances are…
- Jay Fields' Thoughts
-
Polyglot World
3 Nov 2009 | 7:06 amAt QCon 2008 Steve Vinoski told me he uses at least 4 languages pretty much every day. At the time I thought 4 seemed like a lot of languages to use. Are we ready for a world where programmers need to know so many languages?If you think about building a web application, you probably need to know a server-side language, HTML, Javascript, CSS, SQL, etc. Of course, there's no easy way to draw a line and say that those are, or are not all languages. I'm not sure the distinction matters, what does matter is having effective tools to get your job done. Maybe 4 languages isn't surprising.I've worked… -
Refactoring: Ruby Edition available.
21 Oct 2009 | 6:08 pmRefactoring: Ruby Edition is available (and In Stock) on amazon.com.Sorry it took so long, I hope it is worth the wait.© Jay Fields - www.jayfields.com -
Pressure, Expressed in Initial Development Time
10 Sep 2009 | 6:18 amdef Initial Development Time: In software development projects, initial development time (IDT) is the length of time it takes from the project's first line of code until the business derives notable value from it.I've done plenty of projects in my career, some with an IDT of a few months and some with an IDT of a year or more. Based on those projects I've decided that I like the following equation to express the pressure felt by a team at any given moment during the IDT.pressure = Fibonacci(current month of IDT)note:This equation assumes all other variables are normal. Obviously a team that… -
Staying Current: A Software Developer's Responsibility
20 Aug 2009 | 6:44 amI have a personal hatred for weekend conferences*. To me, a weekend conference ensures that I'll be "working" for 12 straight days.I understand that opinion isn't universal. Some people have problems getting time "off" to attend conferences. These situations feel like a fundamental misunderstanding of a software developer's responsibilities. Part of your (software developing) job is staying up on current technologies. That means doing some research during your day.(almost directly stolen from Ward on technical debt)If you spend your entire day coding and never looking at new things, you… -
Macros Facilitate Expressive Code
17 Aug 2009 | 8:38 pmSomeone once asked me if I thought Clojure was more expressive than even Ruby. I didn't have enough information to form an opinion then, and I still don't now. However, I recently noticed something that led me to believe the answer could actually be yes.I was looking through the code of clojure.test on Friday and I noticed something interesting. In clojure.test, the form(s) passed to the "is" macro are wrapped by a try/catch. It caught my eye because I often want to do the same thing in other languages, and usually I have to settle for much less elegant solutions.Here's a bit of example code…
- Bruce Williams
-
Joining Reductive Labs
I’m happy to announce that I’ll be joining the great group down at Reductive Labs, the makers of Puppet, later this week. I’m really excited about the job switch; Puppet’s been in wide production deployments for some time, and it has a large, active open source community that’s grown up around it. The company has the startup flavor that I enjoy, a product that progressed past vaporware and dreams of rainbows and unicorns to become something real and useful to scores of people, and it has a cocktail of varied and compelling challenges to whet my appetite. I look… -
Ashes to Ashes
FiveRuns became one of the most prominent brands in the Ruby on Rails ecosystem over the last few years; a frequent sponsor of conferences and the source of a number of Rails-focused products and open source projects… but within months of going into beta with their latest product, Dash, a cascading set of EOLs were announced: the TuneUp server, Manage, and then, finally and inexplicably, the recently released Dash. Then FiveRuns itself was gone — acquired by Workthink, about which no one knew the faintest. That’s how it looked from the outside, at least. The view from inside… -
Living without send(), or trying to
Object#send (or __send__) is a scrappy little tool we Rubyists pull out to ever-so-casually ignore method private and protected visibility, and to call methods dynamically. Maybe we’ve gotten into the habit of using it a little too often. Let’s play with alternatives. An evaluation Here’s an example from practically every monkeypatching Rails plugin init.rb you’ve ever seen: SomeRailsConstantsend:include MagicSauce Okay, so include is a private method, and we’re breaking through indiscriminately by using send. If you wanted to do away with send because it seems… -
A GitHubby config.gem hack
I love using gems from my Rails apps, and have been an outspoken proponent for gem plugins from the beginning (you won’t find any vendor/plugins in my newer apps at all). I also love GitHub, but lines like this, over and over in my environment files, just annoy me: configgem 'username-foo' :lib => 'foo' :source => 'http://gems.github.com' configgem 'username-bar' :lib => 'bar' :source => 'http://gems.github.com' So, here’s a quick little hack. It could be smarter, but it works. module GitHubbyGems def gemname options if… -
A sleep hack
A quick aside. I’m experimenting with the Everyman polyphasic sleep schedule for the next 3+ weeks. Update: The experiment ended early, but was still very successful. Feel free to contact me if you’re interested in this sort of thing.
- PeepCode Products
-
Ruby 1.9 Part II
15 Oct 2009 | 4:55 pmPeepCode has teamed up with Gregg Pollack, Jason Seifer, and David A. Black of Envycasts to provide you with their current library of screencasts! Jump into the future of Ruby with part 2 of this two part series on the distinguishing new features of Ruby 1.9. Topics covered in this 35-minute screencast include: Block Variables Strings Encoding Object-wide Newness Start with Part I if you haven’t seen it yet! Available to PeepCode Unlimited subscribers, or with your PeepCode credits, or as a single purchase for only US$9! -
Ruby 1.9 Part I
15 Oct 2009 | 4:49 pmPeepCode has teamed up with Gregg Pollack, Jason Seifer, and David A. Black of Envycasts to provide you with their current library of screencasts! Jump into the future of Ruby with this two part series on the distinguishing new features of Ruby 1.9. Topics covered in this 41-minute screencast include: Hashes Arrays Symbols Enumerators Enumerable RubyGems Part II completes the series and is available now. Available to PeepCode Unlimited subscribers, or with your PeepCode credits, or as a single purchase for only US$9! -
Meet Sinatra
12 Oct 2009 | 2:34 pmWith technical assistance from Sinatra creator Blake Mizerany. As a developer, you’re always looking for ways to write faster applications with less code. The Sinatra framework hits a sweet spot for writing small, fast web applications and web services with Ruby. In this 64 minute screencast, Dan Benjamin teaches the basics of Sinatra: configuration, handlers, blocks, and templates. You’ll master these techniques by writing a simple ad server to manage and deliver images, Javascript, and HTML. You’ll enhance the application to track clicks using DataMapper and Sqlite3 to… -
iPhone View Controllers Part II
28 Sep 2009 | 10:49 pmCo-authored by Alex Vollmer, author of the Evri iPhone app and the PeepCode Screencast on MacRuby. Our first iPhone View Controllers screencast (Part I) was an instant hit. This screencast completes it and continues the momentum in our new series of iPhone development screencasts. In this tutorial you’ll become confident using the simple yet powerful table view controller. You’ll learn about layout, interaction, workflow, capabilities, and tips for working with tables. We go beyond simple usage to show how to use a custom cell that dynamically displays multiline text. And… -
iPhone View Controllers Part I
14 Sep 2009 | 7:57 pmCo-authored by Alex Vollmer, author of the Evri iPhone app and the PeepCode Screencast on MacRuby. After months of production and over a year of anticipation, it’s the first PeepCode Screencast on native iPhone application development! The iPhone is possibly the most revolutionary computer device of the last few years. The good news is you can learn to write native applications for it! Programming applications for the iPhone is radically different from writing web applications, but we’ll take you through both the high-level concepts and the line-by-line code to understand it.
- has_many :bugs, :through => :rails - Home
-
Railssummit Slides
18 Oct 2009 | 11:47 amHere are the slides of my presentation at Railssummit 2009. Huge thanks to Locaweb and Fabio Akita for organizing the conference and having me there. My talk was about Rails focused tips/tricks. Lessons Learnt in 2009<object height="355" width="425"><param /><param /><param /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=lessonslearnt-091018133732-phpapp02&rel=0&stripped_title=lessons-learnt-in-2009" height="355" width="425"></embed></object>View more documents from pratiknaik. Or you can download the pdf from here. -
Make your shoulda tests faster with fast_context
20 Sep 2009 | 10:36 amI’ve been using Shoulda for a while. And for my current project, I decided to go fixtureless with Shoulda + Factory Girl. All good, except one problem. Slow as fuck tests. So here’s fast_context as a solution for it. fast_context compiles all the ‘should’s within a context into a single test. For example : 1234567891011 class UsersControllerTest < ActionController::TestCase fast_context "#new" do setup do @user = Factory(:user) get :new end should_render_template :new should_render_with_layout :users endend This will be compiled into something like : 12345678 class… -
save! > save
7 Aug 2009 | 7:24 amThoughtbot folks have a great article on not expecting exceptions – save bang your head, active record will drive you mad. I’ll admit, just like the poster, I used to use save! in controllers to DRY my code. And have a global rescue_from in application.rb. But over the time, I changed the camp and now I’m fully in that “Don’t expect expectations” camp. Some things are more important that DRYing 3 lines of code. But I’d want to take this a step further. When you’re not expecting something to fail, always use the methods that raise exceptions on failure. So I strongly disagree… -
USE INDEX with Active Record finders
6 Aug 2009 | 5:16 amMySQL doesn’t always pick the right index for your queries. Hence, sometimes you must tell it which index to use. Consider the example : Activity.all(:conditions => [created_at >= ? AND country_id = ?, 10.days.ago, 79]) Running EXPLAIN on the above query : EXPLAIN SELECT * FROM `activities` WHERE (created_at >= '2009-07-27 12:58:44' AND country_id = 79); Possible keys : index_activities_on_created_at,index_activities_on_created_at_and_country_id Using the key : index_activities_on_created_atAs you can see, even though the table has index on both the fields involved in the query –… -
Ruby I don't like #3 - Object#freeze
5 Aug 2009 | 7:19 amObject#freeze annoys me. Not a lot, but enough to bitch blog about it. So, freeze lets you make sure no one else modifies your precious little object : 123456 >> a = "hello">> a.freeze>> a << "wtf"TypeError: cant modify frozen string from (irb):23:in `<< from (irb):23 However, freeze does not protect the variable. It only protects the value. 1234 >> a = "hello">> a.freeze>> a += "wtf"=> "hellowtf" The weird behaviour is even more visible when you’re dealing with arrays : 123456789 >> x…
- Riding Rails - home
-
Community Highlights
22 Oct 2009 | 7:43 amI’m always impressed by the continuous flow of innovation from the Rails community. Below are just a few of the highlights from the past month. These stories all came from the Ruby5 Podcast, which covers all the news from the Ruby and Rails community twice weekly. Authentication The talented Brazilian guys over at Plataformatec released the Devise gem this week, a new authentication option for your Rails app. Devise is a Rails Engine which sits on top of Warden, a Rack authentication framework. This makes Devise a little more flexible then other Rails authentication libraries, and is… -
What's New in Edge Rails
12 Oct 2009 | 2:40 pmSo, Edge Rails is still chugging right along. There are new and interesting fixes, changes, and refactors going on all of the time. So, lets take a look at just a few that've gone in since the last post (it's been a while, I know, I'm sorry!). ActionView and Helpers XSS escaping is now enabled by default. This means that if you want to explicitly output HTML to your views, you'll probably have to mark it as html_safe! before sending it through. <%= 'my <a href="http://www.rubyonrails.org">safe</a> string'.html_safe! %> Many of the built-in helpers have been updated for this… -
RubyEnRails 2009
15 Sep 2009 | 1:15 pmRubyEnRails 2009 goes down this 30/31 October in Amsterdam. Talks are in English and Dutch. RubyEnRails has been all-volunteer for four years running, building on a history of sweet venues, good talks, and great company. It’s gradually grown from a local gathering to a full-fledged European event, and this year it’s also stepping up to fill the shoes of RailsConf EU. Yehuda and I are speaking and will be mixing a potent batch of Rails 3 kool-aid. Please join us for a sip! -
What's New in Edge Rails: The Security Edition
6 Sep 2009 | 10:07 amIt's been a bit over two weeks since the last WNiER ("winner"?) post and in the time since our last visit, Ruby on Rails 2.3.4 was released to fix some reported security issues. It is important that you try to upgrade your applications as soon as possible, or even just apply the provided patches if a full upgrade isn't easily accomplished in your situation. Along with this release, you're also going to see several bug fixes and enhancements to the Rails framework, coming from many contributors, that have been discussed here over the previous weeks and even a few that are mentioned just below. -
Ruby on Rails 2.3.4: Security Fixes
3 Sep 2009 | 11:04 pmWe’ve released Ruby on Rails 2.3.4, this release fixes bugs and introduces a few minor features. Due to the inclusion of two security fixes, all users of the 2.3 series are recommended to upgrade as soon as possible. Security Fixes 2.3.4 contains fixes for two security issues which were reported to us. For more details see the security announcements: CVE-2009-3009 – XSS vulnerability Timing Weakness in MessageVerifier and the Cookie Store Bug Fixes Thanks to the success of the BugMash we have around 100 bug fixes as part of this release. Of particular not is the fix to reloading problems…
- ruby on rails blog
-
Using a Rails collection partial with a counter
30 Oct 2009 | 7:48 pmI was reworking an application today and noticed there was a portion of the code that was rendering a counter. # what I saw <% @wheels.each_with_index do |wheel,count| %> <%= render :partial => "wheel", :locals => { :wheel => wheel, :count => count} %> <% end %> # you might also be doing <% count =0 %> <% @wheels.each do [...] -
Multiple database connections with Rails
11 Oct 2009 | 1:22 pmRecently a client requsted that I add a new admnistration panel to an existing Rails application. I thought to myself, “That sounds simple enough?”; welll, things are never as simple. In addition to this control panel, they wanted to use an existing MySQL database and its contents which, of course, did not follow the Rails [...] -
Cisco VPN and Snow Leopard
13 Sep 2009 | 2:47 pmAfter upgrading to Snow Leopard 10.6 I’ve run into yet another quirk. I tried to log on to our VPN and the Cisco VPN client gave me me the following dialog box: “Error 51: Unable to communicate with the VPN subsystem. Please make sure that you have at least one network interface that is currently [...] -
Watermarking images paperclip’s post-processor
8 Apr 2009 | 2:44 pmFor those of you who wanted to use thoughtbot’s paperclip plugin to manage image uploads but were having trouble watermarking said images, behold! http://github.com/ng/paperclip-watermarking-app/tree/master -
Dynamically set a domain for a Rails asset host
14 Mar 2009 | 3:07 amI’ve been wanting to implement an asset host for my Rails app, looking over the API I saw that Rails’ asset_host only supported a single domain. I’m running multiple domains off one Rails app, so this would have been a problem. After a little research, I came up with a solution that would work for [...]
- Rails Envy » Home
-
Rails Envy Podcast – Episode #098
28 Oct 2009 | 12:10 pmEpisode #98- “I leave my syntax out when company comes over.” Important inaccuracy in this week’s show: We have misrepresented Bryan Liles as having written the dm-is-schemaless plugin when, in fact, it’s actually Bryan Smith. Sorry guys! The Rails Envy podcast is brought to you this week by NewRelic. NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. Check them out at NewRelic.com. Show Notes Gemcutter will become default host for gems Gemcutter will become the default… -
Rails Envy Podcast – Episode #097
22 Oct 2009 | 2:32 pmEpisode #97 Lieutenant Commander Boson reporting for duty. Get the ring tone. The Rails Envy podcast is brought to you this week by NewRelic. NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. Check them out at NewRelic.com. Show Notes RPM For Java RPM 2 Now supports Java and Ruby 1.9. nginx push module Nginx HTTP push module – Turn nginx into a long-polling message queuing HTTP push server. Railscast episode on Formtastic Ryan Bates shows how to use Formtastic in your views. The Art of the… -
Rails Envy Podcast – Episode #096
16 Oct 2009 | 1:39 pmEpisode #096. Dan Benjamin (Playgrounder, Hivelogic) is back this week. We each had some background noise and an awkward moment. But it’s funny. The Rails Envy podcast is brought to you this week by NewRelic. NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. Check them out at NewRelic.com. Subscribe via iTunes – iTunes only link. Download the podcast ~14:30 mins MP3. Subscribe to feed via RSS by copying the link to your RSS Reader Show Notes GitHub Discontinues Publishing Gems… -
Rails Envy Podcast – Episode #095: 10/08/2009
8 Oct 2009 | 10:31 amEpisode #095. Dan Benjamin (Playgrounder, Hivelogic) is back this week and we keep it quick while still packing in the news. The Rails Envy podcast is brought to you this week by NewRelic. NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. Check them out at NewRelic.com. Subscribe via iTunes – iTunes only link. Download the podcast ~12:00 mins MP3. Subscribe to feed via RSS by copying the link to your RSS Reader Show Notes Top story: Request log analyzer 1.4.0.1 Released… -
Rails Envy Podcast – Episode #094: 10/02/2009
2 Oct 2009 | 10:58 amEpisode #094. Dan Benjamin (Playgrounder, Hivelogic) is back this week and we had some help from Adam Keys with stories. Also, I shamelessly steal a Mitch Hedberg joke and apply it to Rackspace. In case you missed it last week, we’re now accepting stories and feedback to @railsenvy on Twitter. You know, if you feel like letting us know about something. The Rails Envy podcast is brought to you this week by NewRelic. NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. Check them out at…
- Slash7 with Amy Hoy - Home
-
Doing the Work, with lessons from Magnum PI
28 Oct 2009 | 5:46 amIntroductory interface talks are boring. More importantly, by neccessity, they are the same old content recycled. And recycled uselessly, to no end. Because if the audience members were interested in interface design, they would already know the content of the talk. Or, to put it another way, if they didn't already know the content of the talk, they clearly didn't care. So when I gave a talk last week at the Italian Perl Conference, in Pisa, Italy, I didn't give the type of introductory interface design talk that you'd expect. Instead, I gave a talk entitled: "Doing the Work" In Doing the… -
Nearly Sold Out - Berlin JavaScript Master Class
20 Oct 2009 | 4:14 amA quick note for our European friends—especially ones who we'll see at JSConf Europe. Become a JavaScript Master Our one-day JavaScript Master Class is coming to Berlin, November 9, right after JSConf. If you feel like you've got some room to improve your JavaScript when it comes to understanding the hardcore-iest parts of the language, like the deep ins & outs of the object model, or knowing when and how to use closures, or how to make the DOM your bitch (yeah really), you should come. Not to mention, we'll talk about how to handle large JavaScript code bases without tearing your hair… -
24-hour tweet drive to #beatcancer
16 Oct 2009 | 9:40 am<style> .beatcancerbadge{font:16px/22px Arial !important;font-weight:bold !important;color:#317ac0 !important;display:block !important;padding:60px 0 0 240px !important; width:700px !important;height:180px !important;background:left top no-repeat url(http://beatcancereverywhere.com/images/badge.png) !important;text-decoration:none !important;}.beatcancerbadge ul{padding:0 !important;display:inline !important;text-decoration:underline !important;font:16px/22px Arial !important;font-weight:bold !important;text-indent:0 !important;margin:0 !important;}</style>I'm helping to raise funds… -
How to Write Your Sales Page
13 Oct 2009 | 7:54 amIt's Time to Redesign The Sales Page! Part 2 (Part 1) So, last time on "It's Time to Redesign The Sales Page!" we talked about why I decided the Freckle Time Tracking sales page had to be totally redone. Namely: We weren't proud of the design, so we didn't promote it We didn't believe it was effective at reaching our visitors, so we didn't promote it So these problems break down into two categories: Visual appearance Message/content Because the message/content issue is much harder than the visual appearance, that's where I started. Tune in next time for the design. Pre-work: Why, and Who? To… -
Pimpin' [Software Projects] Ain't Easy
28 Sep 2009 | 8:29 amI spent this weekend at CURUCamp—that is, Central European Ruby Camp—here in Vienna. It totally kicked ass, I got to hang out with friends, make new friends, and learn stuff. (Plus, thanks to Jürgen the organizer, I now know a place where I can get a decent mojito in stodgy old Vienna. Good thing, too, cuz I feel a mojito-emergency coming on in the near future. But I digress.) And I gave a short talk of my own: Pimpin' [Software Projects] Ain't Easy. Pimpin' [Software Projects] Ain't Easy It's a theme I keep coming back to, because so many of the people (and projects) I care about are…
- Softies on Rails - Home
-
Ruby Job Opening
26 Oct 2009 | 8:59 amI’ve got a Ruby Software Engineering position open on my team at Leapfrog Online, in Evanston, IL. The ideal Rails candidate has: Real-world experience using MVC frameworks to build high-traffic web sites and applications. While we don’t expect any graphic design skills from our developers, candidates should be well-versed in the world of HTML, CSS and Javascript/Ajax. Knowing how to develop RESTful applications is a big plus. A love of testing and test-driven development. You should know how to write standard Rails unit tests, and/or a popular specification framework like RSpec, shoulda,… -
Last Call for Rails for Everyone
1 Oct 2009 | 5:53 amTechnically the registration window has closed, but if you sign up this week we’ll let you in. Register now. -
Registration Now Open for Essential Javascript
21 Aug 2009 | 4:43 amRegistration is now open for Essential Javascript with jQuery, a one-day, action-packed, fun-filled workshop for everyone that wants to learn how to integrate Javascript into their .NET, Rails, PHP, or straight-HTML web applications. We’ve secured a great location right in the heart of Chicago’s downtown (right across the street from the Sears Tower, in fact). If you’ve been wanting to learn Javascript, our friendly, inclusive workshop is the place for you. Seats are limited, so register today. -
RT The Learnometer
16 Aug 2009 | 12:38 pmPhoto credit New article posted on the Purple blog called The Learnometer. -
Survey For WindyCityRails Tutorial Attendees
4 Aug 2009 | 1:48 pmFor those of you coming to the morning tutorial at WindyCityRails, I’d like to customize the session to make it even better for those who are coming. This 3-question survey will take no more than 24 seconds of your time: Click here to take the survey here. For those of you still on the fence, what are you waiting for? It’s coming right up on September 12, 2009, so sign up today.
- Polishing Ruby
-
Unit Testing Applications in Cocoa
27 Oct 2009 | 1:56 pmhttp://chanson.livejournal.com/tag/unit+testing is a wonderful resource for getting unit tests up and running in cocoa (esp under the debugger). One of the comments was a gem and I pulled it out and fixed it up to work a bit better... This converts your project to run your application's unit tests under gdb. I can't get it to work under XCode's script menu, but it should work fine under the system wide script menu. (* To debug the unit tests, in the "General" tab of the executable info window, the "Working Directory" must be set to "Build Products directory" Modify the testFrameworkPath for… -
osx_keychain version 1.0.0 has been released!
16 Oct 2009 | 11:35 amProvides API and a command line tool to Access the OS X Keychain. The command line tool isn't actually useful (use security instead), but demonstrates the usage quite well. Changes: 1.0.0 / 2009-10-16 1 major enhancement Birthday! http://rubyforge.org/projects/seattlerb -
omnifocus version 1.3.0 has been released!
11 Oct 2009 | 3:17 pmSynchronizes bug tracking systems to omnifocus. Changes: 1.3.0 / 2009-10-10 1 minor enhancement: Added ability to re-open tasks. (aja) http://rubyforge.org/projects/seattlerb -
rubyforge version 2.0.0 has been released!
21 Sep 2009 | 12:18 pmA script which automates a limited set of rubyforge operations. Run 'rubyforge help' for complete usage. Setup: For first time users AND upgrades to 0.4.0: rubyforge setup (deletes your username and password, so run sparingly!) edit ~/.rubyforge/user-config.yml rubyforge config For all rubyforge upgrades, run 'rubyforge config' to ensure you have latest. Changes: 2.0.0 / 2009-09-21 Modified to use RubyForge REST API rather than scraping HTML. http://codeforpeople.rubyforge.org/rubyforge/ http://rubyforge.org/projects/codeforpeople/ -
rubyforge version 1.0.5 has been released!
14 Sep 2009 | 11:24 pmA script which automates a limited set of rubyforge operations. Run 'rubyforge help' for complete usage. Setup: For first time users AND upgrades to 0.4.0: rubyforge setup (deletes your username and password, so run sparingly!) edit ~/.rubyforge/user-config.yml rubyforge config For all rubyforge upgrades, run 'rubyforge config' to ensure you have latest. Don't forget to login! logging in will store a cookie in your .rubyforge directory which expires after a time. always run the login command before any operation that requires authentication, such as uploading a package. Changes: 1.0.5 /…
- BuildingWebApps Articles
-
Web 2.0 Expo: TV and Radio with an API
National Public Radio (NPR) is changing what it means to be a news organization. While traditional news organizations want to keep their content close, NPR has taken the approach of making content widely available via an API – an approach they call “brand and release.” They’ve made 250,000 stories, going back 13 years, available through their API. Zack Brand from NPR said that the NPR API is getting about 2 million requests per month, and there are 1,300 registrants (you have to register to get access to the API). Content is available in a variety of formats; so far,… -
Web 2.0 Expo: Web Developer Tools
Ben Galbraith and Dio Almaer of Ajaxian and the developer tools group at Mozilla gave a wide-ranging talk on web developer tools. They noted that the web often seems more like a hack than a platform — it’s amazing that developers are able to make web apps do the things they do. This is especially true with Ajax raising the bar for interactivity, and sites turning into applications instead of documents. They’re out to make the web a better platform. Some future technologies that have them excited: HTML5 canvas Fast JavaScript — kicked off by Chrome, Firefox’s… -
Web 2.0 Expo: Social Media
The conference sessions at Web 2.0 Expo had a major emphasis on social media. I only attended a couple of these talks, about which I have brief comments below; at the end of the article, I have links to several others. Social Media Marketing – why it fails and how to fix it This one felt somewhat remedial to me, with the essential points being: Be authentic. You need to be a person, not just a representative of a company. It’s hard to change the marketing culture in an organization to deal well with social media. (A point that I was glad to gloss over, being in my tiny… -
Web 2.0 Expo San Francisco Spring 2009
March 31 – April 3, San Francisco Last week’s Web 2.0 Expo seemed like a successful event, with a good-sized crowd despite the economic malaise – due in part, no doubt, to unusually aggressive discounting and promotion. With multiple tracks across four days (one day of workshops and three of conference sessions) there was much more to see than any one person could possibly attend. Here’s a few articles that we’ve written about talks at the conference: Web 2.0 Expo: Social Media Web 2.0 Expo: Web Developer Tools TV and Radio with an API Many of the presentations are… -
Enhancing Conditional Routing in Rails
Rails’ routing infrastructure supports the concept of conditional routes: preconditions that must be satisfied before a particular route will trigger. Rails 2.1 supports one built-in condition, HTTP method checking, which is of some use but rather limited. What I needed was to be able to limit certain routes to only trigger when a particular host-name was used to access the application. I thought I’d have to write messy additional logic until a little comment tucked away in ActionController::Routing::RouteSet and ActionController::Routing::Routing caught my eye. Here I briefly…
- jarin udom's tumblelog
-
Like a million bike cops
5 Nov 2009 | 11:53 pmvia tweetie Posted via web from jarin’s posterous | Comment » -
Junkyard Wisdom
5 Nov 2009 | 6:40 pmPosted via web from jarin’s posterous | Comment » -
M.O.P - Ante Up (Feat. Busta Rhymes & Remy Ma)
5 Nov 2009 | 5:22 pmAnte Up (Feat. Busta Rhymes & Remy Ma) by M. O. P. Download now or listen on posterous 06 Ante Up (Feat. Busta Rhymes & Remy Ma).mp3 (5839 KB) From Posted via email from jarin’s posterous | Comment » -
Cookie Monster is on Google's homepage today. Turns out he has been using Google for 27 years!!
5 Nov 2009 | 4:42 amvia youtube.com Posted via web from jarin’s posterous | Comment » -
Fan-fucking-tastic negotiation tips from Ramit Sethi (@ramit)
5 Nov 2009 | 3:28 amPosted via web from jarin’s posterous | Comment »
- ones zeros majors and minors
-
Redis to the Resque
-
SORT in Redis
Now that Hurl is open source I thought I'd talk a bit about one of my favorite open source projects: Redis. In Hurl we keep track of all the hurls you make, then show them to you on the "your hurls" page: One of the more fun features is the re-ordering of your Hurls. If I click on the Twitter URL then hit 'Send,' I can re-issue the request and see the new response. The next time I visit the "your hurls" page, the Twitter URL will have moved to the top of my list: This is probably pretty trivial in a SQL database, but Hurl uses Redis - a key/value database. How do we do this kind of sorting? -
Hurl is Open Source
Yep. Check out Leah's post for details, including the Hurl homepage, Hurl Twitter, and, of course, the live Hurl site. -
rake start
I'm working on a Sinatra app that uses MongoDB. I'd love to start both Sinatra and MongoDB at the same time, then kill them at the same time, too. Luckily we can use Rake's multitask for this. namespace :mongodb do desc "Start MongoDB for development" task :start do mkdir_p "db" system "mongod --dbpath db/" end end namespace :haystack do desc "Start Haystack for development" task :start do system "shotgun config.ru" end end desc "Start everything." multitask :start => 'mongodb:start' 'haystack:start' Now I can… -
Homebrew + Mysql + Snow Leopard
I just had trouble installing and running Mysql on 5.1.39. Here's what worked: brew install mysql This printed some instructions which got mysql running just fine, but the mysql gem decided to be difficult - uninitialized constant MysqlCompat::MysqlRes. Some googling found the solution: export ARCHFLAGS="-arch i386 -arch x86_64" gem install mysql -- --with-mysql-dir=/usr/local \ --with-mysql-config=/usr/local/bin/mysql_config That's assuming your homebrew prefix is /usr/local. Worked for me!
- Rail Spikes - Home
-
Let a human test your app, not (just) unit tests
29 Oct 2009 | 10:06 amI’m a big believer in unit testing. We unit test our Rails apps extensively, and we’ve done so for years. On some projects, we do both unit testing and integration testing using Cucumber. I preach unit testing to everyone I can. I’d probably turn down a project if the client wouldn’t let us write tests (though this has never come up, and I don’t think it would be a hard sell). But for a long time, that’s all I did on my projects. Our clients and users would find the bugs that got past the developers. They were, in effect, our QA testers. (I think a lot of small/agile teams are the… -
Building a Video Delivery Network in 48 hours
28 Aug 2009 | 8:00 amLast weekend, I participated in my first Rails Rumble. Rails Rumble is a 48-hour app building contest. We started from scratch Friday evening – you can have concepts and notes on paper, but no code or digital UI assets – and stopped Sunday evening, after 48 hours. You can use open-source code and public web services, and we made liberal use of both. Our team consisted of myself and three of the Sevenwire crew: @fowlduck, @brandonarbini, and @steveheffernan. That’s two developers (Nate and myself), one developer/UI combo (Brandon), and one UI guy (Steve). All in all, a really good mix… -
ActiveRecord refererential integrity is broken. Let's fix it!
18 Aug 2009 | 5:21 pmActiveRecord supports cascading deletes to preserve referential integrity: 123 class User has_many :posts, :dependent => :destroyend But you really only want cascading deletes about half the time. The other half, you want to actually restrict deletion of a record with dependencies. ActiveRecord doesn’t support this. Think of an e-commerce system where a user has many orders. Once an order has gone through, you shouldn’t be able to delete the user who placed the order. You need a record of the order and the user who placed it. Or even more obvious, think of a lookup table. An Order… -
Weird Gem Error
9 Aug 2009 | 11:21 pmTalk about a hard problem to diagnose! I canceled the installation of Rack 1.0 half way through because I realized I was running the wrong command (I didn’t use sudo like I wanted to). After that, I couldn’t load rack at all, even though I could see it in my gems directory and I could load other gems there. I got a LoadError, like this: irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'rack' LoadError: no such file to load -- rack from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from… -
Rails 2.3.3 upgrade notes: rack, mocha, and _ids
29 Jul 2009 | 10:38 amI upgraded two apps to Rails 2.3.3 today. It’s a minor release, and there’s not much to report. But I did run into three minor problems. Mocha Mocha 0.9.5 started throwing an exception: NameError: uninitialized constant Mocha::Mockery::ImpersonatingAnyInstanceName A quick update to Mocha 0.9.7 cleared this up. Array parameters in tests In functional tests with Test::Unit, passing an array to a parameter stopped working. Previously, I had something like this: post :create, :user => {:role_ids => [1,2,3]} This would post the following parameters:…
- Dead Programmer Society
-
PostgreSQL on Ubuntu on EC2: Backing It All Up
10 Oct 2009 | 11:19 amThis post continues what I started with "PostgreSQL on Ubuntu on EC2: The Installation Guide". Once you have your PostgreSQL database server instance running, you will need to backup two different things: your database data, and the instance itself. The database data will be backed up using Elastic Block Storage (EBS) snapshots. Once we have the instance running the backups correctly, we will then create an Amazon Machine Image (AMI) that will allow you to launch a new instance to replace the database server in case it goes down.Backing Up The DatabaseFirst, we need to connect to our database… -
Happy 200 Posts: My 10 Personal Favorites
13 Sep 2009 | 3:42 pmI was shocked to discover this morning that this is to be my 200th blog post. Wow! It has been a good run so far since I restarted the Dead Programmer Society in 2006, and I really appreciate the awesome feedback and support that I have received from the community.To commemorate this personal event, here is a list of my top 10 favorite posts, in no particular order:1. "I'd Rather Be A Jazz Programmer"2. "Fear And Loathing At RailsConf 2009"3. "Programming Zombies Will Crush You"4. "The Twitter 1-2-3 Rule"5. "Goldilocks and the Three Icons"6. "Money In The Ghetto"7. "I Speak For The Code"8. -
PostgreSQL on Ubuntu on EC2: The Installation Guide
15 Aug 2009 | 1:27 amFor some time, I have had clients hosting a couple different applications on Amazon EC2 using Ubuntu. One of these apps uses PostgreSQL, and has been running without event for quite a while. Yesterday, I got to catch up for lost time, by spending the entire day wrestling with data recovery issues related to a failed apt-get upgrade on an important database server. Luckily, the awesome Eric Hammond was around on IRC, came to my rescue, and coached my thru my self-inflicted pain.If you are not interested in PostgreSQL, you probably just stop here. Nothing to see folks, move along. However, if… -
The FutureRuby Revolution Will Not Be On AOL - Part 2
25 Jul 2009 | 9:37 amFutureRuby Day 2 began in a seemingly calm and reflective way. Coffees were sipped, and hangovers nursed. As the self-inflicted wounds from the Pravda-Vodka-Kalashnikov faded, Pete Forde, our leader and spiritual adviser, began a short sermon.His message was simple: Vegas is a horrible place to hold RailsConf. And we should live in a manner that follows the "Four Agreements". Seriously, yes, he said both of these things.Pete told us of the source of his sudden enlightenment: Portland's Jupiter Hotel. Instead of a Gideon bible, they have copy of Four Agreements in each room. Pete, being a… -
I Have Seen The FutureRuby, And It Is Amazing - Part 1
16 Jul 2009 | 5:05 pmIt was with tremendous excitement that my brother Damen and I had arrived in Toronto for FutureRuby. Not only were we getting to attend the reprise of what had been by all accounts the "Best. Conference. Ever.", but we were going to be speaking about Project Flying Robot. There had been many interesting interactions with various security personnel on the journey, thanks to the many small homemade electronic devices that make up our tiny squadron. All of them were extremely friendly and professional as they carefully unpacked, swabbed, scanned, then repacked our cases full of joysticks,…
- Intridea - Company Blog
-
Quick Tip: Readable Conditional Validations in Rails
3 Nov 2009 | 5:57 amThis is something that many may already use as a best practice, but if not it’s something simple and convenient to add to your repertoire. Sometimes you may have a model that requires additional information if a certain condition is met. For example, I may require a user to add more information about themselves if they wish to be listed publicly, whereas I would not if they do not wish to be listed. By combining ActiveSupport’s Object#with_options and ActiveRecord’s conditional validations, we can implement this behavior in a straightforward and readable manner (assuming… -
Use Augmented Reality to Find Your Vehicle With Car Finder for iPhone
2 Nov 2009 | 1:47 pmIf you’ve ever parked your vehicle in a large parking lot you’ve realized that it would be great to have something help you memorize where your car was. Intridea’s latest iPhone application, Car Finder, helps you do just that. Unlike the cookie-cutter car finding applications in the App Store, Car Finder helps you find your car using augmented reality. Using the camera, A-GPS and the compass built into the iPhone 3GS, Car Finder allows you to find your car by positioning an overlay on top of a live view of what’s in front of you. Also, when you mark your car Car Finder… -
Presently Adds SharePoint Integration
29 Oct 2009 | 2:47 pmWe’re always looking for ways to make it easier to integrate Presently into your day-to-day workflow. Today, we’re happy to announce something that will make it much easier for businesses using Microsoft’s SharePoint to integrate Presently. Starting today businesses can use the Presently SharePoint Web Part. The Presently Web Part will allow you to view and post updates to your company’s Presently account from directly inside your Microsoft SharePoint portal. For more information on the installation and usage of the Web Part, you can visit the SharePoint application… -
Find Great Sushi Anywhere with SushiMe on iPhone
29 Oct 2009 | 10:58 amAdding to Intridea’s collection of great food finding applications for the iPhone, like iPho and iCurry, comes SushiMe. SushiMe allows you to find great sushi restaurants around you using your current location or any location that you specify. You can sort through a list of restaurants by their rating (provided by Yelp) or by their distance. With SushiMe you can also view a map of all of the restaurants around you and even call them directly from your iPhone to make reservations. SushiMe is a free application and is available right now in the App Store. Intridea offers services for… -
Present.ly Updates iPhone App With Camera and Attachment Integration
8 Oct 2009 | 9:02 amPresent.ly, our enterprise microblogging platform, which is used daily by many large corporations and government organizations, offers native versions of the application on all major mobile platforms. Today, Apple has approved the latest version of Present.ly for iPhone. Included in this latest version is an updated user interface. The new user interface ditches the previous dark theme and replaces it with a look that is more familiar to iPhone users and is easier on the eyes. Uploaded attachments can be viewed directly from the phone. Updates with one or more attached files are indicated by…
- ELC Code Feed
-
Friday late night hacking
6 Nov 2009 | 1:57 pmPairing with Heineken on some cool stuff we will show you soon - live from Paris -
Add Solr Searching to External Gem and Third Party Database
5 Nov 2009 | 4:49 pmProblem Say you have a third party database that you need your rails applications to access. But of course you want it to be modular and use it again for other applications, so you write a gem to provide access to the non-rails standard database. Now you want to add in acts as solr to search across the database from your application. Solution Acts as solr is a rails plugin and requires a solr server instance be running and therefore its not necessarily correct to add in the acts_as_solr plugin into your gem library. The consuming applications should be responsible for indexing what they and… -
batch finding composite primary keys [SOLVED]
5 Nov 2009 | 11:14 amIssue with composite_primary_keys and find_in_batches. In short, they don't play nicely together. Issue: Rails 2.3+ find_in_batches will not work if your model has composite primary keys. Solution: I found this gist: https://gist.github.com/105318/13fe7c42c95c820fadbad84d54e00680ce9d110f which solved the issue. I just dropped it into a file in RAILS_ROOT/config/initializers to extend active record to be able to do batch finds on those models which use composite_primary_keys -
[SOLVED] 64bit MySQL and 32bit Ruby: FAIL
5 Nov 2009 | 6:22 amFor the people out there using RVM to rock multiple Ruby versions, here's a gotcha with REE and Snow Leopard that took me hours to solve: if you happened to boot your mac in 32-bit mode when building ree with the oh so awesome: rvm install ree And then install MySQL 64bit and try to install the gem, ruby will positively hate you. It will also do it's best not to help you understand the issue whining about missing libraries and whatnot. No, it's not a library issue. Your ruby is built for 32bit and the mysql libs are 64bit. I know for sure nokogiri has the same issue and I think many others as… -
iPhone Tech Talk World Tour - San Jose
2 Nov 2009 | 12:56 pmLast week I went out to San Jose, CA to go to Apple's iPhone Tech Talk World Tour! Apple once a year holds 9 single day "Tech Talks" across the world. This year only 3 were in the US and I was lucky enough to get a spot at the San Jose meetup. The conference was focused on getting developers to use best practices in all regions of their applications. Apple's stance was even if the app is small, it might as well be designed as well as possible. The day started with a nice overview of the iPhone platform. They sell tons of these things and people seem to love the App store. No real news there.
- Rubyology
-
Rubyology 84: Heroku Addons with Oren Teich
31 Oct 2009 | 12:01 pm@ChrisMatthieu interviews Oren @Teich of Heroku about their new add-on services that just launched on October 29th. These services are like an appstore for deployment options. Check out this fun interview to learn more about super simple cloud deployments! -
Rubyology 83: Ruby IDE/Editor Deathmatch
10 Aug 2009 | 3:12 pmRoundtable discussion on Ruby IDEs and text editors. Participants: Marc Chung, Preston Lee, Saul Mora, Benjamin Smith. (OpenRain web development ninjas.) Google Group Alternate AAC Version -
Rubyology 82: Railsconf 2009 Final Day
12 May 2009 | 8:52 pmChris Matthieu and Saul Mora recap the final day of Railsconf 2009. -
Rubyology 81: Day 2 of Railsconf 2009
9 May 2009 | 8:42 pmChris Matthieu and Saul Mora recap day 2 of Railsconf 2009. On location. -
Rubyology 80: Heroku Interview, RailsConf 2009
9 May 2009 | 9:42 amThe Heroku founders were interviewed at Railsconf 2009. We discuss their platform, niche, and business including how they came up with their name. This is probably one of our best interviews yet - hope we are getting the hang of it!
- Kai Richard Knig
-
Tweets on 2009-11-04
4 Nov 2009 | 1:59 pmRT @Apfelkuh_de The power of root http://bit.ly/4GyEHs # -
Kai’s daily tech #40 …
4 Nov 2009 | 1:04 pmLearn.GitHub – Its woth visiting -
Kai’s daily tech #39 …
3 Nov 2009 | 1:00 pmReally easy continuous integration with Signal -
Kai’s daily tech #38 …
2 Nov 2009 | 2:12 amZFA | Mediengestalter – -
Kai’s daily tech #37 …
31 Oct 2009 | 2:00 pmProjects — Solutious, The Performance Company. Stella — Solutious, The Performance Company. Amazon RDS: Amazon Relational Database Service or MySQL in the Cloud for Ruby On Rails. Underscore.js – Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without [...]
- Engine Yard
-
Rails Roadshow Recap
5 Nov 2009 | 2:05 pmIt’s been a whirlwind few weeks, but the Rails Performance in the Cloud Roadshow is complete, and we’re all back home! We had a great time getting out and meeting customers and prospects, and, of course, talking about cloud performance. If you missed it, or just want a refresher, the three Engine Yard slide decks are now available. Attendee James McElhiney beat me to the punch with his review, but I still wanted to take a few minutes to talk about how things went. We started with Boston, and then moved to Chicago, Austin, Los Angeles and Seattle. Our partners Amazon Web Services,… -
Win a Motorola DROID Programming Contest: “Worst App Server Technology Ever”
3 Nov 2009 | 7:30 amThe goal of this contest is to collaborate with your other contestants to build the “worst app server ever” (WASE) , and use it to complete one or more challenge computations. The challenge computation(s) and their input data-set(s) will be announced and posted next week on Thursday, November 12. The contest will remain open until Monday, November 16th at 6pm PST. Winners will be announced within the following week. (Update: We think the rule-set below is now complete, but we still welcome any suggestions or tweaks that you might have.) There will be three prizes. The first… -
Distlockrun: Lockrun for Your Cloud
30 Oct 2009 | 11:40 amLockrun is a handy little utility for ensuring you don’t run two of the same cron job (or other task) at the same time on one machine. It’s especially handy when the cron job in question has a widely varying duration. Lockrun was written by Steve Friedl and initially released in 2006. However, when you have jobs that use resources from multiple machines, lockrun isn’t adequate. Consider a cron job that builds a local index of a bunch of NFS-mounted files. You don’t want more than one consumer of that NFS volume to index it at a time, otherwise performance will be… -
Security vulnerability in nginx
29 Oct 2009 | 12:40 pmA security vulnerability in nginx has been reported. This vulnerability is exploited via a null pointer dereference, and although this has been characterized as a Denial of Service attack, we suspect that it can be exploited to execute arbitrary code. As such, it’s important for all nginx users to upgrade or patch this vulnerability as soon as practicable. All versions of nginx prior to 0.8.15, 0.7.62, 0.6.39 and 0.5.38 in the 0.8, 0.7, 0.6 and 0.5 nginx codelines are vulnerable. Engine Yard customers have already been contacted via email about this issue. For Engine Yard Cloud… -
Announcement: Engine Yard Cloud Price Reduction
27 Oct 2009 | 11:28 amAs many of you have heard, Amazon announced pricing changes this morning. Customers have been asking if Engine Yard pricing will be adjusted accordingly, so before you call your rep, here’s your answer! Effective November 1st, we will be reducing the prices that we charge for instance hours in Engine Yard Cloud, passing through the announced price reduction in Amazon EC2 pricing. These prices will be in effect automatically for the November billing cycle. New and existing customers will not have to do anything to activate the new pricing, you will get the price reduction automatically…
- Saturn Flyer
-
Cache key for collections in ActiveRecord
27 Oct 2009 | 9:01 amI’ve been working on the performance of a Rails application and much of my recent work involves simply caching. It was an application that was an excellent proof-of-concept which quickly turned into a production application. We’ve got memcached setup and running and now it’s a speedy little interface. But one thing I knew I needed but wasn’t sure how to do was cache a group of records. Rails fragment caching is super simple for one record: <% cache [object] do %> ... this will be cached based upon your object.cache_key ... <% end > That’s fine and… -
Changes in Radiant AdminUI for 0.8.1+
19 Sep 2009 | 12:00 pmThere’s a lot of focus on the visual changes to the Radiant interface, but there are some functional changes that should be discussed too. I’ve started playing with the new AdminUI as I try to understand the changes (since I haven’t had time to take part in the development). The first thing I tackled was figuring out how to rearrange the navigation items and it’s not too easy to understand what’s going on. First, here’s the new structure of the tabs: NavTab #=> [NavSubItem, NavSubItem, ...] NavTab is a subclass of Array and it’s accessed via… -
Fat Free CRM on Heroku
8 Sep 2009 | 4:46 amHeroku is an excellent way to easily deploy Rails applications. But there’s a trick to doing it: it’s a read-only file system. To some, this may be old news, but to others who have come across a project using SASS, you might feel like your out of luck. Fat Free CRM, for example is a great new project, and it uses SASS. Try running it on Heroku and you’ll start getting frustrated. If you’re not familiar with SASS, it automatically generates static CSS files for you in production, meaning it needs write access to the file system. So, what do you do? The good thing is… -
Why you should use Devver
28 Jul 2009 | 12:21 pmFor good reason, developers share concern over not only a well-tested application, but also a regularly tested application. If you are managing a group of developers and are responsible for the outcome, wouldn’t you first find a solution to allow your developers to run the test suite whenever they want? If your team members are running tests whenever they want on your massive application it’ll probably slow them down, so of course you’ll implement a continuous integration server. But then you’re left with the requirement that they checkin their code. That could be a… -
Textpattern on Github
28 Jul 2009 | 10:34 amI’m a former user of Textpattern and I’m glad to see it more easily accessible on github. I hope it’ll be easier for other users out there to contribute to the project. My path to abandonment began when I built a real estate management interface on top of Textpattern. It was an interesting experience to say the least. The system is built to provide clear methods like graf() which I’m sure you would guess is a way to display an HTML paragraph element… And of course, for your developing delight there are other methods like sLink(), eLink(), wLink(), dLink(), and…

