This was probably the funniest bug description I’ve encountered. Not as funny as Unit tests fail when run in Australia or We can’t send mail more than 500 miles, but it’s really hard to beat those!

So what exactly went wrong? Our Windows batch script uses the current date and time to compose a file name, which is then passed as an argument to a Java application. So far so good. But why does it fail before 10 a.m? Let’s see how Windows handles dates and times:

$ echo %DATE%
08.05.2015

$ echo %TIME%
9:34:52,75

We get a leading zero for days and a space for one-digit hours! This explains why our script failed:

$ java -jar application.jar 2015-05-08- 9-34.txt

So we just replace leading spaces with zeros, right? Nope. The time/date format is country-dependant and can be fully customized… We are supposed to use something like this instead:

$ wmic os get localdatetime /format:list
LocalDateTime=20150508093452.386000+120

This pretty much sums it up:

“It’s a complete nightmare for a BAT programmer.”
PA., StackOverflow

Comment and share

Sometimes you want to keep some files in your repository, but you don’t want to commit them into your version control system. That’s basically what .gitignore or .hgignore are for. Depending on the team size, this file can become polluted very fast with personal rules, like steve-testing/. It’s much cleaner to define user-specific ignore rules in a second ignore file, which is stored locally:

Git

1. Open {repo}/.git/config and add the following:

[core]
excludesfile = {repo}/.gitignore.local

Alternatively, run the following command in your git repository:

$ git config core.excludesfile .gitignore.local

2. Create {repo}/.gitignore.local and add ignore rules the same way as in .gitignore

Mercurial

1. Open {repo}/.hg/hgrc and add this:

[ui]
ignore.local = {repo}/.hgignore.local

Notice: you need to use an absolute path here.

2. Create {repo}/.hgignore.local and define ignore rules the same way as in .hgignore

The idea of using a .local suffix comes from StackOverflow.

SVN

Unfortunately, there is no real alternative for SVN. However, some SVN clients (e.g. TortoiseSVN) provide a workaround using the ignore-on-commit changelist to ignore files locally.

Comment and share

Putty is a very popular SSH client for Windows. I don’t like the default color theme, but I couldn’t find a satisfying one. So, again, I had to create my own. And that’s what it looks like:

Putty Scheme - Eclectide

There is mostly no difference between normal and bold font. Additionally I’ve switched the cyan and yellow colors, because I really like this golden tone and it is more present in the daily use.

Continue reading

I’m currently learning Node.js, and therefore experimenting a lot. Motivated by a Todoist support thread, I wrote a little backup tool for Todoist:

Todoist Export

Check out the Live Demo.

My main goal was to learn the Jade template engine (and the concept in general). As far as I can tell it’s the recommended way to write dynamic front end code for Node.js applications. It looks interesting, but I’m not sure I would use it for a more complex project.

Todoist already offers daily backups. However, their format isn’t suitable for data processing. Their API returns all tasks as JSON, which makes it easy to convert the data into other formats. This tool supports CSV export, too. I’ve also added an option to export everything, which includes user settings.

I’m not planning to implement any more features, but I will host the service as long as people use it. I’ve published the source code at GitHub.

Comment and share

Update 14.01.2017
I’ve updated this theme after some breaking changes in IntelliJ IDEA 15+.

When I first saw some Sublime Text screenshots I was impressed with the Monokai theme. I’ve searched for a similar color scheme for IntelliJ IDEA and I’ve found multiple. However, they didn’t look well compared to Sublime Text. Considering the amount of time software developers spend looking at their editor, I invested a lot of time to assemble a perfect theme for me.

Monokai theme

I’ve been using a dark theme since JetBrains released Darcula. Not because it’s cool (though it is!) or because it’s supposed to be better for the eyes. It’s because I can process different colors and their meaning much faster. Use a dark theme for a week and switch back to understand what I mean.
My main goal was to highlight fundamental pieces of code without making it too distracting. After using and adjusting it for several months, it’s time to finally publish it.

  1. Download my Eclectide Monokai color scheme:
  2. File → Import Settings → Select the jar file
  3. Restart IntelliJ
  4. If the color scheme isn’t applied automatically, go to File → Settings → Editor → Color & Fonts and select the right scheme

Alternatively, you can download the settings as XML from GitHub and put it in your config/colors folder.

The color scheme supports many languages (no Ruby or Objective-C) and should work in all JetBrains products (IntelliJ IDEA, PhpStorm, WebStorm, PyCharm, …). You can easily adjust the scheme for any language support in the settings (see point 4.).

Comment and share

Recently I came upon cursors.io - a massive multiplayer maze game with a social twist. A really simple idea with an amazing experience. It reminded me of a small school project I developed as a teenager. It was a quick maze game with some neat MS Paint graphics made by my friend. I decided to port it as a browser game to check out the Phaser library.
At one point I realized there is no way to set the mouse position using JS. It makes sense, so people can’t abuse it. However, the whole game concept depends on it. Fortunately there is a Pointer Lock API to lock the mouse within an HTML element. It is only supported by Chrome and Firefox, but that’s fine with me. Check out the source code at GitHub. And here’s a live demo:

Labyrinthz

Comment and share

Log file syntax highlighting in Notepad++

It’s always a pain to analyze log files using a text editor. The good news is that Notepad++ supports user-defined languages, so I wrote a custom syntax highlighter. I’ve kept it simple: green numbers, grey strings and custom colors for different log levels. But this little bit of color usage is a huge improvement while scrolling through tons of black text. Here’s how you enable it:

  1. Download this XML file
  2. Import the file: LanguageDefine your language...Import
  3. Restart the application.

Files with .log extension automatically use this syntax highlighter, but you can always activate it manually: LanguageLog file. You can also adjust the colors and/or keywords using the same dialog, no XML hacking needed.

Comment and share

Update 11.08.2015
The V1 API is deprecated. I’ve updated my script to work with V2 (without using OAuth2).

Recently I migrated my movie collection to Trakt.TV. I’m very careful with my data and I don’t want to lose it in case the service is ever discontinued. So I wrote a little script which exports my:

  • Library
  • Watchlist
  • Ratings

I’ve uploaded my script so you can backup your own data. Make sure, your Trakt profile is not private, so the script can access your data.



The data is zipped as JSON in separate text files. If you prefer other formats, you will find converting tools on the web (e.g. CSV).

You can also call this script directly, e.g. save it as a bookmark or use wget:
https://darekkay.com/service/trakt/trakt.php?username=USERNAME

Although the script doesn’t alter anything on Trakt and I’m not storing any of your data, I have to include a disclaimer:

I do not take any responsibility and I’m not liable for any damage caused through use of this service.

You can check out the source code on GitHub. Feel free to adjust it and use it on your own web server.

Comment and share

I’ve switched from Spotify to Google Play Music (also known as “Google All-Inclusive” or “Google All Access”) a while ago. Although I can’t imagine Google losing any data, I want to make sure I don’t lose any of my playlists by accident. Google doesn’t offer a backup feature (yet?), so I needed another solution. Luckily there is an unofficial Python API, so writing a backup script was fairly easy. It saves the content (id, title, artist, album) of all user-created playlists as XML.

Continue reading

Switching from Eclipse to IntelliJ IDEA was a great decision. Eclipse of course gets things done, but not as fast, not as flawless, not as intelligent as IntelliJ.
And yet, the switching process took me some time. Especially learning new shortcuts was a little bit irritating. Performing basic tasks took me minutes, because I had to look up the correct shortcut each time. It’s possible to use an Eclipse shortcut mapping, but since I wasn’t going to switch back, I’ve decided to learn the default mapping. JetBrains offers a nice overview (PDF) containing most important shortcuts. In order to find the correct row faster, I have added another column with Eclipse shortcuts.

Continue reading

Update 09.02.2016
The latest NirvanaHQ update made this userscript both obsolete and deprecated.

There are tons of tools for time and task management out there. After trying out some of them I decided to stick to NirvanaHQ. Using IFTTT I forward all of my virtual inboxes except emails to NirvanaHQ. I no longer have to check my unseen YouTube videos or new Soundcloud uploads. I find them all in one system and process them regularly.

I have written a little userscript, which adds a “Hotkeys” button to the top menu. It opens a popup window, containing all the available keyboard shortcuts. I find it useful, to quickly look up some hotkeys.
You can get the latest version at GitHub.

NirvanaHQ Userscript

Comment and share

Sencha GXT Showcase

I work professionally using GWT and Sencha GXT. Sencha offers a showcase, which is a huge help to understand their components. Sometimes I need to alter their examples in order to test something. Copying all necessary files is quite laborious. Since the source code is provided along with the library, I decided to set it up under Eclipse. In this article, I want to share all the steps and pitfalls with you. Continue reading

Wordpress supports auto-embeds: certain links are automatically converted into embed widgets. Embedding YouTube videos is done by simply pasting the URL. Unfortunately the video quality is low by default. It’s possible to specify the quality using the vq parameter. Auto-embeds don’t support parameters, though. There is a way to manipulate the generated html code by adding parameters to each embedded YouTube video automatically.

Continue reading
MooMovies

I guess every software developer has written a cd/dvd management software. It’s a great way to learn a new programming language or framework, since you have to get familiar with different aspects (UI, databases/xml, …).
After working with GWT/GXT for over 1 year I wanted to try out Vaadin. I also wanted to replace my old java desktop movie management tool with a new fancy web app. A few weekends later I was very satisfied with the result, which doesn’t happen a lot for a perfectionist like me. ;)

Continue reading
  • page 1 of 1