Ruby

Where to find Rails’ default validation error messages

I’ve been playing around with simple_form and I18n in Rails a LOT in a recent project. I’ve been customising form labels and validation messages using the internationalisation features – it works really, really well.  There is, however, one small problem.  When you start, you are presented with an almost blank YAML file and some very flakey documentation at the bottom of the simple_form readme.  How do you know how to structure that YAML file?  What attribute names should you use?

Continue reading

Things Storm bookmarked this week 04/01/12

Liam:

Happy New Year! My bookmark to start 2012 is batman.js – It’s a nice little CoffeeScript or Javascript framework for building web apps. You can find more info at http://batmanjs.org/ – or have a look at some pretty examples

Adam:

A couple of libraries that devs might like.

Chosen is a jQuery plugin to make super sexy drop-down lists with auto-complete. It should be very useful for making long drop-downs far more user friendly.

Thinking Sphinx is a Ruby library to bring Sphinx full text search into ActiveRecord and looks really easy to get started with. Full text search is needed when you want decent search results on strings and Sphinx is one of the leading open-source solutions, so this plugin should come in very handy!

Andrew:

This week a link that i have actually bookmarked- http://www.codecademy.com.  Just released, it is a user-friendly introduction to programming for those of us not gifted in the art of development. it uses pretty badges and you can track your progress and compare it with friends. Having only just been released, its library of classes is quite small, but hopefully as time passes and the site’s profile grows, so will the tutorials.

Paul:

At the Storm Christmas do I was surprised that my colleagues had never heard of The Mother of All Demos. Back in 1968 Doug Englebert demoed a system his team at SRI had been working on since 1963 and featured the first computer mouse, hypertext, collaborative editing, video conferencing and many other ideas that would take decades to become commonplace. It’s a great reminder of how so many of the things we think of as new have been kicking around for years, it just takes time for technology to catch up. The entire demo is available on Stanford’s website as bite-sized pieces, or as one 100 minute video

Mike:

My bookmark this week is very much based on the fact we’re probably all looking for something that isn’t work to remind us of the holidays just gone. Little Alchemy is a beautifully simple game where you combine two elements to create a new one. Then you do it again and again. Then you realise you’ve only got about 18 out of a possible 220, and go slowly bonkers trying to work out the others. Exactly what is required when there aren’t enough mince pies around”

Dave:

A really slick work-orientated recommendation engine that uses your twitter network to find opportunities that are well suited to you. WorkFu  is brought to you by, amongst others, one of our Bath friends Mike Kus.

Scott:

Real life Wipeout!

2011: A polyglot programmers journey

At Storm we like our developers to be polyglot programmers. We believe knowing a wide range of languages, APIs and toolsets makes for better programmers and ultimately, better deliverables for clients. It means we can pick the most appropriate tool for a task and deliver an excellent final product. As the old saying goes, ‘if your only tool is a hammer, everything looks like a nail’ – and that’s bad.

So, what have I learnt this year to add to my programming arsenal?


Continue reading

Things Storm bookmarked this week 14/12/11

This week..

Scott: “An awesome video showing a cool proof of concept using 500 sensors with very small time delays to capture the path of small pulses of light travelling through objects”

Adam: ”I recently discovered nCrunch – a very elegant way to automatically run .NET unit tests within Visual Studio and have a visual indication of test coverage. Simple. Effective. Brilliant. Also, I’ve been diving head-long into my first major Ruby on Rails project this week and have found the Rails Guides massively useful”

Dave: ”Some amazing use of CSS3 to create lighting effects in the browser”

Andrew: “A nice practical article I’ve bookmarked on the the importance of UX sketching. I find a lot of value is added to fleshing out ideas on paper, it’s a far more transient process than jumping straight to Photoshop and recommend it to anybody that doesn’t sketch out ideas in the preliminary stages of a project”

Paul: “If you are a TextMate user you’ll know we’ve been waiting rather a long time for TextMate 2.0. Yesterday MacroMates (two years after announcing it was “almost ready”) released an alpha of TM 2.0, with a blog post over here. It’s still a way away from completion, but there are some nice features, like automatic downloading of highlighting grammars, and smoother installation/updating of bundles. And the project draw has bitten the dust. Despite being an alpha release it seems pretty stable. Good enough that I’m using for work and home.”

Mike: ”Although I tend to get funny looks when I talk about non-digital stuff here at Storm HQ, I’m a massive fan of tangible stuff like old-school print. Things like this excite me – so I was totally delighted to read “Twitter by Post” from my friend Giles Turnbull. He’s ace. You should follow him and stuff.”

Things Storm bookmarked this week / 02-11-11

This week…

Dave tells ms that iMessage is coming to OS X: “iMessage is Apple’s new messaging solution for the iPad, iPod Touch and iPhone found in iOS 5. It allows customers to send SMS-like messages over standard data connections rather than expensive text messaging plans.” Also: “AirPlay mirroring is going to mean that meetings around the Storm flatscreen are going to be wireless :-) Can’t wait.

Liam chucked me a super-nerdy bookmark – the guide to Rails 3.1′s asset pipeline. I have no idea what this is so I’ll let him explain: “It’s a pretty scary concept to someone who learnt rails with static content in the public directory, but things like less will change your CSS developing life“.

From Paul – a live coding video from Ryan Biggs building some of an implementation of Conway’s Game of Life in Ruby using a Test Driven Development approach with RSpec: “It’s a good (if slightly long) intro to how to use RSpec, and the basics of TDD.

Adam pointed me to this rather useful “avoiding common mistakes using the new HTML5 elements and attributes” article. Handy.

For me, an oldish but very useful set of printable wireframing templates for hand-sketching new sites and mobile apps.

Things Storm bookmarked this week / 26-10-11

This week…

Dave pointed me to the fact that Google have given their App Store a bit of a facelift. As he points out – “to say that it had a ‘hint of iTunes app store’ is possibly an understatement” – but he’s also right, it’s pretty well put together and always worth spending a bit of time poking around..

From Adam – a neat little Gem which implements scheduled background tasks in Ruby. “It provides a simple way to specify any number of jobs on easily customisable schedules. It can call into other Ruby functions in your code, perform rake tasks or execute arbitrary command line commands.”

Liam “Apple” Gladdy gave me this: a sexy little iOS-app-screen-like web GUI in coffeescript - Now I find I need to go and look up what “coffeescript” is…

And from me – this utterly awesome video/sound piece: “Entire Musical Compositions Made from Just One Line of Code“. Totally tremendous on sooo many levels :-)

Things Storm bookmarked this week / 19-10-11

Things we liked this week:

Adam popped me over this rather nice interview with Peter Norvig giving a run down of AI techniques employed by Google. It’s a long piece but well worth a read as it explains how some of the magic actually works..

For once, Paul didn’t focus on the fail – this time his link (via @elliottkember) is all about testing in Ruby. It’s a tool called Heckle which will systematically break your code in every conceivable way, while running your tests. If a test doesn’t fail * then you need to get writing more. He tells me it’s a great tool for ensuring the quality of your tests, and therefore your code. [ * wait up, a fail! ]

Nicola sent me this interesting post about continual improvement and development – some really interesting stuff in there both for designers and anyone else wanting to up their game..

Liam sent over a couple: Firstly is a rather nice jQuery timeline plugin, called Timelinr (of course!). Second is the new homepage at http://desertbus.org/. Liam tells me that DesertBus is a charity event in which a bunch of Canadians play a mini-game from Penn and Teller’s never-released video game on Sega CD in which you drive a bus in real time, back and forth, until you get bored. They do it for charity every year – he helps them out with a bunch of graphing code of donations over time and other such analytics. Good work!

For me, it has to be the totally non-tech-related story about Fauja Singh finishing the Toronto Marathon in 8 hours 25 minutes. Pretty slow, you might think, until you realise the guy is 100 years old. Singh apparently ran his first marathon at age 89 and has since run seven more. He attributes his success to “ginger curry, cups of tea and ‘being happy’”. An amazing, inspiring story..

Finally, Andrew pointed me to this story over on TechDirt. I’ll let you read it and get cross all on your own, but in short – don’t ever point out a blindingly obvious security flaw on a bank website – it might get you into a lot of trouble. Shocking.

Generating code coverage metrics for a Ruby on Rails project with simplecov

As part of my dive into unit testing Rails applications I was keen to set up a tool to give me code coverage stats.  Code coverage represents the % of your source code that your unit tests exercise.  100% code coverage is a good goal to have and the earlier you hit it, the more likely you’ll find testing a worthwhile endeavour.  Whilst 100% coverage doesn’t guarantee that you’ve tested every permutation in your app, not having 100% coverage guarantees there are bits where daemons may be lurking.


Continue reading