This blog has moved here : http://www.sebaugereau.com
I’m pretty proud of my current project tags feature thanks Rails, UJS & CSS.
I’ll probably write a tutorial for it. Works like a charm (inspired by tumblr tags box).
Any good developer use a console. From creating a new rails application, to launch irb or whatever, command line is your friend.
From my early years as a unix system admin, i kept some useful tricks that often astonished coworkers, shell keyboard shortcuts.
Here’s a litlle list that i use everyday :
Now, lauch a term and give it a try.
I was looking for a decent way to add real images to my fixtures.
Since i didn’t find out anything convenient, i created the following rake task to do so.
To use it, paste the following code in your RAILS_ROOT/lib/tasks/paperclip.rake :
Then, in a console :
RAILS_ENV="test" rake db:fixtures:loadimages CLASS="Image"
It will download a wikipedia sunny pic and store infos in your database and filesystem.
It will also create all the style your define for it.
I’d like to start off by saying that I have been a proud french rubyist for years now. As i often talk about Ruby and its ecosystem to my friends, this post is an attempt to dump some ideas on why so many rubyist (ruby, rails, sinatra developers) are so proud to work with Ruby now.
I’m 30. Like a lot of people my age, I’ve been passionate about computers since an early age. I used to own a 8086 Toshiba Laptop with 256Kb memory, and two 3.5” floppy drives as hard drive (thats not exactly what i would call laptop). I played a lot with things like Dos 3.x and Basic (goto, an incredible feature to create spaghetti code).
It was very exciting.
Years later, i own a Macintosh LCIII and was very impressed with HyperCard. That was a fun technology.
When i was about 18, i heard about Linux (RedHat 5.0 and then Mandrake 1.0, thanks to the talented Gaël Duval). Once again, i was all very exciting.
Owning an unix os at home was an awesome way to understand more than ever the computer sciences in depth. 30 years of great ideas in my box, to play with. What i’ve learned of those years is that cool things can deeply increase my ability to create nice things on my own.
What i’ve learn of those years is that cool things can deeply increase my ability to create nice things.
While i was very interested by internet, i never really found exciting way to develop website. Learning Java was great, specialy understanding OO programming. But its verbosity was forbidding. And to be honest, i was quite depressed anytime I used Swing UI made softwares.
Ugly & without consistency.
Definately not a pleasure to use and to develop with. Definately not a pleasure to use and to develop with. Don’t get me wrong, Java is not a bad thing, nor is its huge collection of libraries but, I never found it fun.
Things like .NET seems great. I mean Microsoft can made cool things. I remember when i devellop my first dynamic pages with ASP. Not so bad. But its very “enterprise” side made its community not so fun.
PHP is *great*. Really. When it deals with people who have good methods. But since its used everywhere, since everyone has their own recipe, you often end up eating spaghetti code.
Then, i don’t really remember how but i’ve heard about a strange named thing making the buzz. They call it RoR. Ruby On Rails. I watched this famous 15 min video made by a cool guy always saying “ooooups” a dozen times. It sounds great. And while i never read ruby code, i was deadly simple to understand what he was doing.
A buzz was created in 2005, and a lot of others technology lovers were passing their time saying that it was only a couple of years buzz. But things that made the difference was the philosophy behind the scene. Opinionated sofware. Convention over configurations. Dont reapeat yourself. To sum up, keep it simple.
And now, i’m very impressed about how a very talented community is making his way to create wonderful things. Dozens ruby gurus sharing their ideas on github & twitter. Hundreds books, thousands great blogs focused on not only doing the thing, but also figuring out the best way to do it. Sometimes called the Rails way. Or the ruby way.
Great projects embrassed this philosophy with success. Github who become the best developers plateforme in a few years. Shopify. Basecamp, even Twitter try to keep things simple…
When Rails 3 was announced late 2008, once again, , I was really impressed about how the community knew how to make great things, without stand one’s ground, often responsible for wasting time in open source. Rails 3 was a deep refactoring release and also a merge with a cool Framework called Merb that made some noise.
Quite unusual actually. Open Source often deals with forking projects or distinct projects, not really merging project. They made a great work. And probably selflessly sometimes.
As web developpers, we have now tools to make great things. But beside tools, we have ideas, helped by all those years of *good opinions* shares. Keeping things simple, beautiful and enjoyable as users and developpers. Being pragmatic.
Its not only about Ruby or Rails now. Its all about node.js , Coffeescript or Backbone.js. Open source projects that come with great ideas. And make our work each day more enjoyable.
Finally, its more than *a way of coding*, but also *way to design* and less expected, way to business (take a look at the 37signals book Rework and its reviews).
For all those reasons, I understand why there’s more and more ruby enthusiast around there.
Some usefull links :
Some weeks ago, i was giving an example how to call Google Translate API in your app to easily translate any kind of content in your views.
John Crepezzi just released a small and nice ruby gem to do it.
As usual, source code can be found in github : https://github.com/seejohnrun/easy_translate.
I’ve been working on a small project lately and i launch it yesterday as http://echosphr.com.
Its not *the* big thing of the web neither the million dollars idea. Its only a few ideas i was thinkin about, or piece of code i wanted to test in the real world.
Nothing too complicated, it’has been built with Ruby on Rails 3, the twitter gem (https://github.com/jnunemaker/twitter), the omniauth gem (https://github.com/intridea/omniauth), Memcached among other things.
Wanted to test Redis but I miss some time.
Some twitter users already come in and i should say i’m quite proud of it.
I’m a bit interrested to see how it’ll respond during a potential high volume traffic.
Even if Google allows embedding all kind of maps in your website without pain, I wanted to give my maps a little css3 flavor.
Edit : it will only work with Firefox 4, Safari 5 and recent release of Opera.
Here’s my 2 cents tutorial to give your map a stunning zooming effect when hovered in pure CSS3.
For a demo, simply hover the map and enjoy the effect here.
Working heavily with named scope lately. I wanted to find a random published “event” post only available on web in a view of our CMS.
And here’s the one line code :
It’s been years i work with ruby & rails. Still amazed.