Elentok's Blog

About me
CSS Sprites Generator

I have been using CSS sprites a lot lately and wanted a tool to generate them automatically, so I wrote a simple python tool (using the python imaging library) to generate a single image (at the moment it just creates a simple horizontal merge of the images).

To use the tool just run the following command:

sprites-gen.py {output-file} {input-file1} {input-file2} ...

You can also set a fixed height (it will rescale every image to fit the height) using the "--fixed-height" argument and define the quality of the output image using the "--quality" argument.

You can get this tool at https://github.com/elentok/sprites-gen

Read more...
Custom CSS folding in Vim

CSS files tend to grow very long, and even if you split them to smaller files, they are still not very easy to navigate.

To make things simpler I'm using Vim's custom folding feature to fold the CSS code into sections:

Read more...
Install PHPUnit on WampServer

I'm using WampServer 2.1 (with PHP 5.3.4) on Windows 7 64-bit.

This guide was made with the help of Itay Adler.

Read more...
Restart the Windows File Sharing Service to fix weird problems

Every once in a while I get this annoying problem where I can't a access my windows shares from other computers on the network, and the only way to get it it to work again is to restart windows.

I recently found out that to avoid restarting windows all you need to do is restart the "Server" service:

  • Win+R => services.msc
  • Right click "Server" and click restart.
Mercurial: Automatically run unittests before commit

To force Mercurial to run your unit tests before each commit and not to allow committing unless the unit tests pass you can use the "precommit" hook.

In the repository root, edit the ".hg\hgrc" file and add the following lines:

[hooks]
precommit = path-to-tests-script
            (e.g. "qtodotxt\test\runtests.py")
Read more...
Tip: Removing a changset from a Mercurial repository

The rollback command only removes the latest changeset, if you want to remove/undo multiple changesets (and all of their descendants) from a repository you can use the "strip" method that comes with the "Mq" extension:

Step 1 - Enable the Mq extension

The Mq extension is distributed with Mercurial so to enable it just edit ~/.hgrc (in windows: C:\Users\UserName.hgrc) and add the following lines:

[extensions]
  mq=

If you use TortoiseHg, then you can just open the settings page, and in the Extensions section enable "mq".

Read more...
Autocomplete textbox for multiple keywords/tags entry in PySide

Last month I started writing QTodoTxt, a PySide (Python Qt bindings) GUI for the todo.txt concept.

While using it for my own todo list I noticed several features that were missing (I intend to implement them all in due time), one of these features was auto-completion for projects and contexts when editing or creating a new task, something like this:

Read more...
Review: MIUI 2.3.4a on HTC Desire

About five months ago I bought an HTC Desire smartphone (it came with stock Android 2.2), at first I was very impressed but as time went by I started noticing a lot of annoyances:

  • It required weekly reboots because it would get sluggish.
  • Hebrew support was less than standard, I needed to install a third-party keyboard, Hebrew text was aligned to the left and numbers in Hebrew sentences appeared backwards ("123" would appear as "321").
  • I couldn't use the Waze navigation application while playing music because the music would stutter.
Read more...
QTodoTxt - Cross-platform todo.txt GUI

Hi everyone,

About a week ago I noticed the todotxt-touch android application which uses a simple text file to store tasks (see http://todotxt.com/) and uses Dropbox to synchronize the file between the mobile phone and other computers.

I liked the idea of using a simple text file, but I couldn't find a good editor for this format so I decided to write one. Since I use both Linux and Windows I decided to use PySide (LGPL Qt bindings for Python).

Read more...
SharpDevelop dark color scheme

EDIT (February 11th 2012): I uploaded the scripts to github, I hope this way it will never go offline again :-)

EDIT (July 4th 2011): I updated the URL again (here and also added the version with highlighting for .NET keywords. If I have some time I'll try to port it to SD4.

I've been using SharpDevelop a lot in the past couple of weeks and I really like it, it's a hell of a lot lighter than Visual Studio and... it's open source!!

One of the things I was missing was a light-on-dark color scheme, so after a little digging I figured out how and here's what I got:

Read more...