Entries Tagged 'development' ↓

Interactive/inline editor in irb

I saw the MountainWest Ruby conference video: code generation: safety scissors of metaprogramming. And the speaker (Giles Bowkett) used vi from inside irb. And I've never liked Vi, but using an editor from within irb is nice! Especially if you're testing a big chunk of code.

So I began crawling the Internet for how he did this and I found the utility_belt gem. The utility belt contains the file I needed. So I installed the gem, edited my .irbrc and now I can use nano/gedit (or any other editor) from withing IRB!

These were the steps:

CODE:
  1. gem install utility_belt

My .irbrc:

CODE:
  1. require 'utility_belt/interactive_editor'
  2. module InteractiveEditing
  3. def nano
  4. edit_interactively(:nano)
  5. end
  6. end

Now to use nano in irb, just type: nano

And the bonus: a nice screencast that shows this feature in action. I tried to edit it with pitivi. But that really sucked. After I finally found it out how I could cut pieces I tried to save it and the whole program crashed. "apt-get remove pitivi"!

40 different layouts

Nice: blog.html.it/layoutgala

Blog themes

I'm not a designer _at_all_ but this post on designing a blog theme is very nice. I really like the copyblogger theme I have now. But maybe I'll try and create something myself. Because a unique theme for a blog is so much nicer.

Also here a post on typography and five principles of effective web design.

com_resize on wordpress plugins

Because I expect a huge, huge demand of my com_resize plugin, I have put it on the wordpress site :)

Now I hope it gets approved.

Nice image resizer

You see all the nice (resized) images on my site? I've made a plugin for them to be generated. Want I wanted was to add an image in the wordpress editor. Give a height and/or width and that they would be resized automatically.

With proud I introduce my resize plugin: com_resize. Why the name? Because I've used the source code from on of my Joomla! mambots. Hence the name.

You can download it here. If you have any question: leave behind a comment.

For installing: just unpack it in the plugins folder and activate the plugin. Your server must have GD installed (or Imagemagick I believe). Maybe I'll release a version with mod_rewrite supported images. But that's only if I'm sore bored I don't what to do else.

Image resize script for wordpress

WordPress is a great blog application. It has some nice free templates and the default installation has everything I need without being bloated. I miss one thing: automatic resizing of images who are too big. So I plan on making it myself. Something like this but even simpler (as well in functionality as in configurability).

Tutorials on writing linux kernel device drivers (usb)

12 inch touchscreenMy boss recently bought some inexio touchscreens. Including a nice little 12.1 inch variant. I thought about using it in my living room for controlling audio et cetera. But alas, a no go. Because there weren't any linux device drivers available for it. So I played with the idea of creating my own driver for it.

Examples enough: usbtouchscreen and mtouchusb. But how to start (I have totally no c experience). I think the biggest problem is getting to know the kernel api. After reading through the source code of some modules I realised that a lot of the lines were kernel macro's & functions and just a little bit of real coding.

Searching for tutorials produced some nice results. But a lot of the tutorials were of a real "hello world" level. And very few (no?) tutorials/how to's rose above the mediocre level. Some few I found:

Helpful, but not really geared towards my problem. So I ordered some books, asked the manufacturer for some info on the protocol (hope they will co-operate!) and spent a lot of time reading tutorials and source code.

But I still have a lot of questions. What is the best IDE (kdevelop I believe)? Why has no c IDE/editor descent auto-completion for kernel functions/macros? Where can I ask my question without being flamed to death?

When the driver is ready (or when the project has failed) I'll post some tips and maybe a full blown tutorial on (not) writing device drivers.

Up to date on GIT

GithubI've been using GIT now some weeks (for my ultra-secret ruby project) and I must say it's nice. Nothing more than nice. Just like svn was nice to use (compared to old-school full backups). When I first saw the GIT commands I was dazzling with confusion. But after two days you get the hang of it. I haven't done anything special like branching so I can't tell you about the advanced features. But the base is solid.

Ow, and github is really nice. I read somewhere that rubyforge now has git support too. Gonna check that out. But beating github will be difficult. Well, at least for now when Github is still free of charge!

testing and Rails

Ratatouille

As a "professional" webdesigner I know how much testing sucks and how it, at the same time, is one of the most important things to do (besides coding the stuff). That's why I appreciate Rails' very complete testsuite so much. And now with Rspec user stories (a nice tutorial here and here) and webrat it's getting even better!

Installing jruby

I used this resource:

http://rorblog.techcfl.com/2008/02/19/create-and-deploy-a-jruby-app-to-the-glassfish-gem-in-10-minutes-or-less-on-mac-os-x/

How to install jruby on Ubuntu:

CODE:
  1. sudo -i
  2. mdir -p ~/src/jruby/trunk
  3. cd ~/src/jruby/trunk
  4. svn svn.codehaus.org/jruby/trunk/jruby/ .
  5. ant
  6. ~/src/jruby/trunk/bin/jruby --version

The current version doesn't work to well with rails' script/console. It is very, very, very slow. So I keep using Yarv until this is fixed. It seems really promising though. Can't wait for Rubinius to become stable!