Monthly Archives: July 2007

Donebox is open source

When I previously announced my last project, some people asked that I open Donebox code.


svn co http://code.macournoyer.com/svn/donebox/trunk donebox

Or check it out on my code site with all the other useless stuff in there.

Patches are welcome and might be deployed to the live site.

Advertisements

9 Comments

Filed under Misc

Me + Rain – Sleep – Girlfriend = Donebox

What do you do when it rains on the weekend ? Remove some sleep and my girlfriend gone on a trip and you’re pretty sure I’m hacking some code.

But before the unveiling, here goes a song by Jimi Hendrix

There must be some kind of way out of here
Said the joker to the thief
There’s too much confusion
I cant get no relief
Businessman they drink my wine
Plow men dig my earth
None will level on the line
Nobody of it is worth
Hey hey

</interlude>

Donebox is:

  • another to-do list manager
  • better then all of them combined !
  • using AJAX like there’s no tomorrow
  • breathing REST like it was born from its flesh
  • degrade gracefully without Javascript
  • FREE
  • live, now, today!
  • made in one weekend so don’t blame me for the bugs even if there are NONE!
  • not working on IE and never will (this is not a bug, it’s a feature)
  • using the scaffold stylesheet, I know …

http://donebox.com

The UI is pretty simple. You add tasks on the top box, on the left you got dated tasks, on the right the ones with no date (later).

Quick task creation

When submitting a new task your can use the follow syntax to be uber productive:

[category] My task description for next week

Autocompletion

The category is optional. It must be specified inside [] at the beginning of the task. The date part is also optional. Donebox uses the amazing Chronic library to parse date. The date must be at the end of the task description. You can use any of these and more: thursday, november, mon, today, tomorrow, thursday next week, 3rd wednesday in next november.

Quick task reordering and date changing

As you might expect from any 2.0 beta to-do list manager, you can reorder tasks by drag-dropping them. But Donebox does a little more then that. You can actually change a task due date by dragging it to another date. Pretty easy and quick.
Changing date

I don’t need another web app to keep up!

Neither I! That’s why you can use Donebox API to script your way to to-do list nirvana. Or you could use one of the scripts I already coded, one bash script usable from the command line and a Quicksilver script.

Comments, suggestions are warmly welcome, as always (unless you’re using IE)!

Hope you like it!

17 Comments

Filed under rails, ruby

MontrealDemoCamp3 follow up

Yesterday I went to MontrealDemoCamp3 with Daniel and Gary. As usual the room was full and the demos were amazing!

Vinismo

Nicolas Ritoux and Evan Prodromou were first and presenting their project Vinismo. It’s a wiki about wines. Already in french and english. They’ve put lots of content in the wiki: the rules, community page, help pages, etc. and left the fun part, filling the wine description page, to the users. It was built on the MediaWiki engine, upgraded with some plugins to allow OpenId authentication and semantic markup on wine description pages.

They clearly won the public, especially when they announced they brought 6 12 (surprising, I’ve only seen 6 of them… thx Even) bottles of wines to celebrate their launch!

WorkCruncher

Heri was next, with WorkCruncher. It’s a todo list manager merged with Twitter style sharing features. But the main “feature” that caused lots of controversy was that WorkCruncher deletes all your items at the end of the day. So you start each day with an empty list. I’m really not convinced this is a good thing, as a fan of David Allen GTD, your list should be there to free your mind. But Heri says he’ve been using it for some time and it truly boosted is productivity.

A private beta if going on, register at http://workcruncher.net/.

Defensio

Finally! I got the see Defensio in action! Carl Mercier and Mat Balez were presenting their WordPress plugin and comparing it to Akismet. It sorts spam by Spaminess, so it’s faster to find false positives (good comments marked as spam). They showed some stats from Ben’s blog which I don’t remember and have no idea what’s the average efficiency of a spam filter, but it was like 98.9% 99.5% (even higher then I tought, thx Carl).

But! The greatest surprise to me was that, the WordPress plugin is built on top of a clear and simple API. Which is by far better then Akismet’s. You have choice over XML and YAML for the output format and it’s free for small project. So blog comment spam is only their initial target. I can’t wait to see with what they come up next: Facebook wall spam filter? Twitter spam filter? Rails plugin acts_as_defensio (oh that would be cool!) ?

Building a counter-clock

Simon Law was next with a live performance.
He tried disassembling a clock to make it go backward. Simon explained some details on how tipical today clocks are built compared to earlier, more expensive clocks. It didn’t worked, well almost. He fixed it during the following presentation and it worked. It was a breath of fresh air from the typical style of presentation. It was, like he called it, an artistic performance. Really great and entertaining!

Private flight planner

Jerome Paradis followed. He presented a project aggregating private flights data onto Google Maps. You could see the travel paths of each flights, planned ones in blue and live ones in green. He got the data out of emails… that’s right emails! Seems that people using this have a strict jargon when writing them, so he’s able to parse all this and end up with some useful results. They’re planning to make this a public service soon. As of now, this is strictly restricted to rich people using private jets. In which case, Jerome said, this service can help them share flights with other business people, save money and make some more by meeting other rich people. Great, where do I start ?

Also, I had the great pleasure to talk with Martin Dufort from Kakiloc, Mitch Cohen from ClixConnect, Mark Schanzleh and Amélie Racine from StayNomad, Philippe K. Chrun from MyCarpoolStation, Alexander Fedorowicz from Oracle and several other ones.

If you missed this one, be sure to put DemoCampMontreal4 on your agenda right now! Daniel will be presenting, you do not wanna miss that.

12 Comments

Filed under conference, Misc, montreal

DemoCampMontreal3

DemoCampMontreal3 at SAT at 18:30, tomorrow.

It’s free!

It’s cool!

All the cool kids are there!

Be cool too:

Be there!

Leave a comment

Filed under conference, montreal

ActiveSupport hidden gems

Even though Rails, as any open source project, lacks some documentation, its source code is open so we’d be fool not to dig in it !

Here are a couple of my findings in the not so publicly documented ActiveSupport source code.

Class attribute inheritance

Ever wanted to create an attribute on a base class that is not shared among its subclasses ?

Sadly @@my_var won’t work, as it will create a class variable shared by all classes
in the inheritance tree. ActiveSupport to the rescue!

class Room
  class_inheritable_accessor :cookies_eaten
end

class Kitchen < Room; end
class BedRoom < Room; end

Kitchen.cookies_eaten = 3
BedRoom.cookies_eaten = 1
Kitchen.cookies_eaten != BedRoom.cookies_eaten

write_inheritable_attribute and read_inheritable_attribute are also really useful in included modules to create variables belonging to the actual class. This is commonly used in Rails macro, for example, controller filters declaration.

Others hidden gems

Module#alias_method_chain

Encapsulates the around pattern, adding behaviour to a method without altering it, which is equivalent to:


alias_method :foo_without_feature, :foo
alias_method :foo, :foo_with_feature
Module#mattr_accessor, Class#cattr_accessor

Like attr_accessor but for module and class variables. Comes also in reader and writer flavours.

Module.delegate

Encapsulates the delegator pattern. So rather then:


def hello
  greeter.hello
end

you’d


delegate :hello, :to => :greeter

Beautiful!

Object#returning

A Ruby-ized realization of the K combinator


def foo
  returning values = [] do
    values << 'bar'
    values << 'baz'
end

foo # => ['bar', 'baz']
Symbol#to_proc

Turns the symbol into a simple proc, which is especially useful for enumerations.


# The same as people.collect { |p| p.name }
people.collect(&:name)

# The same as people.select { |p| p.manager? }.collect { |p| p.salary }
people.select(&:manager?).collect(&:salary)
Array#to_sentence

Converts an array to comma-seperated sentence where the last element is joined by the connector word.


%w(MacBook Guru Rock'n'roll).to_sentence # => "MacBook, Guru, and Rock'n'roll"

Have you found anything else of interest inside the mysterious ActiveSupport ?

2 Comments

Filed under rails, ruby

How to get in the zone in less then 60 seconds

Dr. EvilGreat hackers are 10 times more productive then mediocre programmers. What did I say ? 100-billion-gazillion times more productive. And you know it!

Getting in the zone allows you to be in a state where you’re completely separated from the outside world. It’s just you and the computer. Your fingers against a horde of bits. You know you’re in it when you notice 2 hours later that someone has walked inside the room you’re in.

Here are 5 tips that have helped me achieve that level of focus. I hope this is helpful to anyone else as it was for me.

1. Have a vision

Even before writing the first characters of code you should know in your head what you want the final product to look like. Doesn’t have to be all the details about the database schema and the methods arguments of every classes. But each classes relationship and role could be a good start. As an example, if I’m building a DVD collection website, it’s trivial to determine every possible field of the dvds database table, but it’s crucial to know my dvds table will be the centre of my app. If you have a clear vision, you’ll be driven by it and nothing and no one will be able to stop you from achieving it.

2. Find a setup and stick with it

Although I don’t think having a routine for everything is something good, you should have some fixed parts in your moving train towards coding nirvana. Determine in your vision what are the innovations and automate or routine everything else. For instance, the way you place the windows on your screen should always be the same when you enter coding mode. And when you stop programming, close all those so you record that having this setup mean you’re coding. This way you won’t be distracted by your Google Reader or Adium window.

4. Drop the mouse

no mouseNot using the mouse is the best way to become a very effective programmer. My philosophical reason is that you’re closer to the machine in the way that all you fingers are directly connected to your computer transmitting information as it pops up in your head. Switching from mouse to keyboard is costly, do it as less as possible or only for uncommon tasks.
Using the mouse is good for exploration mode, when you don’t really know what you’re looking for. But since you should have a clear vision of what you wanna do, go with the most direct method of input, the keyboard (until they find a way to connect it right into your brain).

5. Use tests to focus

A common problem with debugging is when you do it with puts (or Console.WriteLine or print) in the code. When you’re done debugging you remove all of them. So when you need to debug again, what ? You add the same puts and prints everywhere.
When debugging with tests you document your assertions in a permanent way. “I wanna make sure this returns ‘stupid puppy’ 46 times”, well don’t


  puts puppy.title

rather


  assert_equal "stupid puppy\n" * 46, puppy_output

in a test case.
The next time you’ll have to fix a bug or add a new feature you can focus on making the test pass, not scanning the output. As with the mouse, scanning is for exploration mode.

5. Put headphones on

headphonesListening to music occupied the left part of you brain. An old study presented in the amazing book Peopleware shows that if you listen to music while coding, you will end up with a less creative approach [1]. This might be true, with new music you’re listening to for the first time. My tip is to listen to music you know by heart. The objective is to eliminate any unexpected variant in ambient sound. If you know the music really well, you won’t be surprised by any sound, it will serve as a constant background noise. It’s a great way to focus real fast and cut yourself from the outside world, you know, the real world

Now what do you do to get in the zone ?

Continue reading

14 Comments

Filed under Misc

Montreal on Rails

Today, I’m really honoured and excited to announce that I’ll be giving a talk at the first Montreal on Rails meeting on the 7th of August somewhere in McGill University MAASS Chemistry Building at 7 PM.

Honoured because this is big news for the Rails community in Montreal. We had some mailing list and user group for some time but it was not really active in the Rails/Ruby domain. So now is the time to make it happen. If you’re from Montreal and use Rails, get up from you seat, scratch your back, pack your MacBook, take a shower, brush your teeth and come have a blast with us. Or if you can’t come, you still can help spread the word! Hey and the fact that there’ll be donuts seems enough for me to come!

You can find more info on the site and on the Upcoming page.

My talk is gonna be about testing with external services and making them freaking fast (and hopefully fun) and if we have enough time (and donuts), possible integration with COBOL and Logo into Rails routing.

Hope to meet you there!

5 Comments

Filed under conference, montreal, rails, ruby