Entries Tagged 'development' ↓

Images & why you need com_resize

I the release post of com_resized there was asked the question why one should use com_resize. There are three reasons to use it:

  1. The generated images aren the size you want them to be. So they’re smaller of size than the original images.
  2. You won’t get any ugly resized images (see the example below).
  3. It works with remote images. So you can link to an image one someone else’s blog and they get resized to the size you want + cached. So that way they get loaded from your own server: so faster.

No more ugly resized images:

The one on the left is without com_resize. The one on the right is _with_ com_resize. If you don’t see any difference. Your browser is probably doing some fancy stuff with the image. In that case you don’t need com_resize. But maybe the readers of your blog do!

For the people who don’t see any difference (leave a comment with your OS + browser, please!) I have attached a screenshot. Made in IE6, so the font is ugly too :)

Released callbacks 0.0.1

Hi all! I’ve released my first project on rubyforge. The sourcecode is on github though. For the  simple reason that my git repository on rubyforge doesn’t work (yet). I hope they will fix it soon.

I’ve setup the project with the wonderful bones of Tim Pease.

I’ve got some reasonable documentation about it, a kick-ass website (stolen from Dr. Nic’s newgem) and some nice unit tests. I’m now integrating the gem in one of my own projects. If that’s succesfull I’m gonna release a version 0.1. The version after 0.1 will have new features.

The website ws generated with webby. A really nice way to create static websites in ruby. Maybe I’ll dedicate a post/tutorial to webby.

So please look at the website, install the gem and give me some feedback. It will be very appreciated!

pushing all git remote repositories

I’m now working on a project that is hosted on github AND rubyforge. And lazy as I am, I don’t want to do:

git push origin
git push rubyforge

That’s why I create a handy shortcut for it and placed it in my ~/.bashrc:

function git-push-all() {
for remote in `git remote`; do
git push $remote
done
}

What it does: it lists all remote repositories linked to that git project and pushes them all. Usage:

git-push-all

Don’t get confused with “git-push –all”! That’s something completely different!

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:

gem install utility_belt

My .irbrc:

require 'utility_belt/interactive_editor'
module InteractiveEditing
def nano
edit_interactively(:nano)
end
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.