home icon contact icon rss icon

Textmode

tools I use

Archive for Home

Opera 9.5 new default theme - huge bars

Just a quick post .. the lastest opera release has a new default theme which looks pretty good.

The only thing that I didn’t like is the height of the bars. After a quick modification it looks much better:

Here is the modified theme, place it into your /skin/ directory and select it.

For the curios: The font is snap from the artwiz font package

I usually only display statusbar, addressbar and tabbar as you can see, everything else is on keybindings.

NCDU - Disk usage Explorer

I think most uf us are frequently looking for a shell one-liner to list largest files on a system, either do clean up because the harddisk is to small, or just find out what’s using the most disk space.

ncdu to the rescue.

If you open up this nice tool, it recursively calculates the disk usage of a specified directory, and provides a neat interface to browse this directory.

It’s very basic, though has some useful options:

  • sort by name, size
  • delete specific files
  • percentages, graphs
  • unit powers of either 1000 or 1024

and more

The only thing I miss are VIM keybindings :)

Factory Girl - Rails fixture replacement

I think you all know that, when using fixtures in your test, you keep switching between files to see what fixtures there are, always struggling with dependencies and conflicts.

There are a couple of helpers that solve this, but this is the best one I came across until know: Factory Girl

As the names says, it provides some kind of factory for your objects and instances.

The following snippet illustrates the definition of such a factory:


# define an incremental username
Factory.sequence :user do |n|
  "user#{n}" 
end

# define a user factory
Factory.define :user do |u|
  u.admin      false
  u.username { Factory.next(:user) } # lazy loaded
end

# define a project factory with associated user
Factory.define :project do |p|
  p.title 'myproject'
  p.creator   {|a| a.association(:user) } # again lazy loaded
end

Now, this factory can be used in your tests:


it "should do something" do
  Factory.create(:user) # creates a user
  Factory(:user) # creates another user (note the shortcut)
  @u = Factory.build(:user, :username => 'customuser') # only build, no save
  Factory.create (:project, :creator => @u)
end

I think you get the basic idea behind it, it’s actually pretty clean and makes tests a lot more readable without looking at fixtures.

Note: At the time of this writing, the attribute name does not work since there is a conflict (that will be resolved soon). Instead you have to use:


Factory.define :project do |p|
  p.add_attribute :name, "myname" 
end

Mibbit Webchat - Online IRC client using Ajax

Everytime I was in need for a good online irc client (webchat), the only applications I found were either Java based, very limited or not even working.

I’m glad I found Mibbit recently, which is a feature rich online irc client using Ajax.

Some features of Mibbit (some are quite funny):

  • supports all major browsers
  • full UTF-8 support
  • multiple server and query connections
  • ‘recent chat’ feature when joining a channel
  • on the fly translation :)
  • smiley fu
  • SSL support
  • per-tab input history
  • integrated pastebin
  • image url thumbnails

You can even integrate it on your own website! Pretty cool..

So give it a try :)

Filemanager and Imageviewer with Vim Keybindings

As I’m using vim all the time, and almost every app I use has vim keybindings, I’m missing two things:

  • a good Filemanager with vim keybindings
  • an image viewer with vim keybindings

Filemanager

There is a built in filebrowser (:explore), and vim plugins like VimExplorer or VimCommander

However, both are not really what I needed.

I like Midnight Commander, but the fact that you can’t configure keybindings, makes it unusable for me.

The best vim-like filemanager I found so far is definitely vifm it has really cool features and is clean and simple. That’s exactly what I was looking for – unfortunately the project seems to be inactive :(

Edit: It’s alive, yay :)

Imageviewer

I did not find a good imageviewer with vim like keybindings :(

Edit: As daftago mentioned in the comments, xzgv looks pretty good.

If anyone knows good filemanagers, imageviewers or other applications with vim keybinding support, PLEASE comment!

Edit: Check Vimperator for Opera

Free Book: Object-Oriented Reengineering Patterns

Some weeks ago we had a course about object oriented refactoring at university, held by Serge Demeyer which was really interesting.

He released a book about this topic with two other authors:

Object-Oriented Reengineering Patterns collects and distills successful techniques in planning a reengineering project, reverse-engineering, problem detection, migration strategies and software redesign.

This book was recently made available as a PDF for free, if you are interested in learning techniques about refactoring and reengineering, check it out.

Client side code highlighting with Google Code Prettify

I looked through various Javascript Code Highlighting scripts today, and finally found Google Code Prettify

It includes a Javascript and CSS file to easily get some syntax highlighting for your code snippets – all magic done on the client side.

Supported languages

  • C variants
  • Java
  • Python
  • Bash
  • SQL
  • HTML
  • XML
  • CSS
  • Javascript
  • Makefiles
  • Ruby
  • PHP
  • Awk
  • Perl

There are also some live examples on the project site.

Easy Setup:

Download and include the files and set the onload attribute of your body tag:


<head>
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
</head>
<body onload="prettify()">
<!-- content -->

Usage

It autodetects the language your snippet is in (as good as possible), to use it, simply add the class prettyprint to your code or pre snippets like this:


<code class="prettyprint">
# code goes here...
</code>