Design Archives

An Arduino/Dancer-enabled mobile-enhanced door

So you're sitting at home, preparing for a karaoke night, waiting for your friend to arrive. She comes in, rings the doorbell and you're thinking "fuck! I'm upstairs, and she's downstairs and I have to open the door for her (because it's locked) but I'm busy changing my clothes." What do you do? WHAT DO YOU DO?

What if you could let her in using you phone while you're still upstairs getting yourself ready? Arduino could be used for that. And the following is a theoretical (and slightly bit practical) explanation on how you could use Arduino and Dancer to accomplish this.

Ardui…

Updates to Sys::HostIP

Sys::HostIP simply parses ifconfig/ipconfig (supports GNU/Linux/BSD/Windows) and gives you the interfaces and IPs found.

I stumbled upon this module when I was looking for a way to clean get all the ips of every interface on machines at $work. I needed something that parses ifconfig cleanly, because I didn't want to do it myself. I found a few and Sys::HostIP was by far the easiest, simplest, fastest and the one I decided to use. I noticed a few bugs open and contacted the author who gave me co-ownership. I since updated it and cleaned most of the ticket pool.

I've recently st…

Call of the callback: Inversion of Control or just coolness?

Suppose I have a Runner which holds a Prober object. I need the Runner to call the Prober and update stuff according to the result. Pretty simple, right?


my $prober = Prober->new(...);
my $result = $prober->check;
if ( $result eq 'whatiwant' ) {
$self->update($stuff);
}

However, I'm running in asynchronous mode, which means I need the prober and update to run somewhere in the loop, and I can't just sit around and wait for a reply. I gotz otha dingz to do, mon! So, I have two options:

- I call th…

Abstract the company away (part 1)

While my department at $work isn't strictly R&D, we still do a lot of development work. I'd dare say we average a rather healthy amount of code, taking into account we also try to be rather minimal. Code is simply a means to an end, it is not your goal.

We get to write a lot of code that interacts with our systems, and a lot of duplication is achieved by mistake. Sometimes it's stuff people don't realize is indeed duplication, or they think it's unpreventable. I've decided to tackle this. I've presented some of my findings at Weborama…

MetaCPAN::API gets updated

Recently I found some spare tuits and decided to spend them on MetaCPAN::API.

My main problem with the old MetaCPAN::API was that I had made a wrong design decision, and failed to take into account the flexibility of MetaCPAN. It really is flexible.

The second time around I decided I'll write it correctly, and test it thoroughly. I've moved to version 'v0' of the API (what was referred to as 'Beta API') and this helped clean up quite a bit. I was able to write it the way I wanted.

/users/sawyer_x/design/index.html

FOSDEM, second report - the talks!

THIS POST INCLUDES PICTURES!

At the second day of FOSDEM, the Dancer core crew pretty time took over the Perl dev room! We are 4 developers, and we gave 5 talks: SPORE (by Franck Cuny), "Code, release, market" (by Alexis Sukrieh), Curses::Toolkit (by Damien Krotkine), Moose (Sawyer X) and Dancer (Sawyer X). Somehow, all those talks mentioned Dancer, whether it was by the speaker noting the projects he works on, or by using it as an example in the talk (like Alexis did). The amount of noise and buzz we created around Dancer was very …

Bringing Mojolicious to the dancefloor

Dancer's engines is really cool. You wanna know how cool? Here's an example.

If you like Mojolicious' templating system and you want to use it with Dancer, our interchangeable templating engines allow you to use a template engine of Mojolicious, if it exists.

And if it doesn't exist, you can write it. Oh wait, someone already did!

You can find it here!

Check out the so…

Dancer FOSDEM fuel, first report

Friday and Saturday have been very productive days for Dancer. We wanted to write up this blog post yesterday night but we were waaaaay too tired for that. Instead, you get it this morning while we're sitting at a great Perl 6 talk by Gabor Szabo.

Friday we met up. I tried to wait for Franck at the train station and got lost... several times. He found me in the end and we went to our hotel room with his co-workers. Sukria and Dams arrived later. It was very exciting to meet the guys I've been working closely with for a while and haven't even met in person yet. Free software sure is nu…

Making your code testable

On my previous post, Ron Savage has commented on the way he uses File::ShareDir with Moose, to be able to use data files in the author's code directory.

While I probably won't use this method since File::ShareDir specifically has the ability to use @INC (which makes my - and kmx's - solution possible), it does raise a very important note. You must make your code testable.

Internal redirects in Dancer

I really like the forward function in Catalyst. It lets you chain actions together and create a clean flow. I decided I want that in Dancer. We now have it.

Some background:
I was working with my brother on a project with Dancer. We wanted a client to be able to go to a personal demo page of the website to be able to try out editing features without destroying the actual website. The original (awful) code did this by copying all the (CGI) code into a different folder and making that available.

Our idea was to have a demo database t…

About Sawyer X

user-pic Gots to do the bloggingz