Latest Articles

xdebug with XAMPP on Mac OS X

{ No Comment }

Xdebug logoI just upgraded my XAMPP to latest release and found myself trapped with no memory of how to install xdebug on a Mac with XAMPP.

{ Read more... }

Git reset –merge

{ No Comment }

Or how to reset a merge commit?

If just after a merge commit you recognized that it was actually "git rebase" that you wanted to do, then your friend is:

git reset --merge 14c1d90c3e

where the target commit is the one preceding the merge.

But when reset is not an option?

But if you found the faulty merge after several other commits (or after pushing to remotes), resetting is not so good idea or won't work at all. In that case refer to How to Revert Faulty Merge in the HowTo.

Vim unindenting comments

{ No Comment }

I was annoyed that Vim moved all comments to the beginning of the line the moment I entered # sign. Searching around first turned me to smartindent, but I found that was already off.

Then this vimtip shed the light on the monster:
http://vim.wikia.com/wiki/Restoring_indent_after_typing_hash

just add to your .vimrc:

set cinkeys-=0#

And you are good to go.

Ruby lambda

{ 3 Comments }

I stumbled upon a problem with one of my scripts: how do you split a yielded block between two different callers while conforming to the DRY principe? The answer is lambda method.

{ Read more... }

MacFUSION workaround

{ No Comment }

Upgrading to OS X 10.6.3 broke the excellent MacFusion mounting app. For those like me, who depend upon SSHFS mount, there is a workaround using static sshfs mounting.

{ Read more... }

Chrome ad blocking

{ No Comment }

I noticed that all of a sudden my Google Chrome (Mac OS X version) has a ~ 10s delay between displaying a web page and making the links clickable.

At first I suspected my password manager extension that it scans through the page for possible forms to fill, or some other extension. So I went through a Search and Destroy sequence with all of my extensions but for avail, until I disabled the AdBlock extension.
Suddenly all is fast again. Alas, now the ads slow it down. { Read more... }

iMovie and MTS

{ 4 Comments }

A few times before I have imported my short clips from the Sony HDR-CX106 camcoder directly using iMovie camera import features. Now, that I had a bit longer videos on the camera, I got to thinking why it takes so long and how come it reports that 60 GB of my hard drive will fit only 1 hour or so full-quality video. It turns out that by importing, iMovie probably converts all the clips into HDV compliant format, thus MPEG2 and thus resulting in wasting my hard drive space.

{ Read more... }

FFmpeg steals input

{ No Comment }

I had a shell wrapper script to convert MTS files with FFmpeg, but somehow, when running on multiple files, only the very first one got converted.

Turns out that FFmpeg swallows the stdin from the bash script when it is run and therefore nothing remains in the stdin for the next iterations. To remedy this, I had to fake input to ffmpeg:

while read movie
do
echo "" | ffmpeg -i "$movie" -vcodec copy -acodec copy "$movie".mov
done

Without the echo command this would've ended after first iteration, regardless of the number of files in the input.

BTW, the above command is useful for turning MTS files into MOV files, while preserving the audio-video streams, for software that does not support MTS.

Rapid AppStore rank-up through twitter

{ No Comment }

The case study: Rivals

I decided to give away current version Rivals for free, until next major feature update. A day later when checking on the sales numbers, my jaw dropped to the floor. The number of downloaders had jumped up a 10 000%. Yes, you read that right - more than a 100 times up: { Read more... }

Building iPhone apps with Rake

{ No Comment }

Building and releasing iPhone apps and at the same time versioning them easily can be a bit tedious. Several posts (like this or this) show how to use agvtool for automated versioning. But for me this is still not automated enough.

{ Read more... }