Nerdblog.pl

F**k Yeah Fast Food is now open source!

Like I said in my previous posts - this is my open source day :)

Over a year ago I took part in Rails Rumble 2013. Because it was our first time, we've decided to create something utterly silly and because we were all fast-food and alcohol enthusiasts, we've decided on creating an app about fast foods while being drunk ;)

The effect? F★★k Yeah Fast Food - foodie app that fetches images from Instagram and shows them on a map so you can look for delicious food in your area and actually see how it looks like in reality.

The app is available online on http://fuckyeahfastfood.com/ and the source code is now available on GitHub.

Just remember - it was made for fun and in very short time so the quality of code is not exactly up to our normal standards ;)

Client-side video duration

For one of the projects I'm working on I've tried to create a mechanism to get the video duration before the upload (because we need the duration for various things and uploading video takes a lot of time).

Turns out it's possible and it's quite easy but there are too many caveats for any practical application:

var input = document.getElementById('input_file'),
    video = document.getElementById('video_file');

video.addEventListener('loadedmetadata', function() {
    console.log("Video duration", this.duration);
}, false);

input.addEventListener('change', function() {
    var objectURL = URL.createObjectURL(this.files[0]);
    video.src = objectURL;
    console.log("MOO");
}, false);

Results are varied and depend on both the supported media formats and support for video duration. For example Chrome on Mac has no problem with both mp4 and webm but fails silently for AVI with mpeg4 video or mkv format. Firefox didn't support mp4 at all and mobile browsers has returned either NaN or 0, therefore limiting the potential use and requiring a solid fallback.

I've created a jsfiddle if you want to play around with it.

Rails Rumble 2014

Wow, it's been such a crazy last few days that I completely forgot to brag on my blog! That's unacceptable!

Me and my buddies from Growth Republic and around have taken part in Rails Rumble 2014! It's a hackathon where you have 48 hours to come up with and develop a web application. The only requirement is that you do not use any assets you have created beforehand (open source libraries do not count as long as either you are not the author or you are but they are not a core part of your project), the app is based on Rails or any other Rack-based stack and your team consists of at most 4 people.

Let me proudly present to you our project, it's called Gilgamesz.

A photo posted by Michał Matyas (@nerdblogpl) on

A photo posted by Michał Matyas (@nerdblogpl) on

Gilgamesz is an application that allows you to create text-based games of the Choose Your Own Adventure variety. Probably some of you remember those neat books that gave you a choice of what to do next by going to a proper page? This is something like this only on-line and a bit better.

Our system is pretty rudimentary (remember we only had 48 hours and a skeleton crew) - you can create your own story, add items and have inventory-based events because of that. No programming required!

I'm not saying our app is perfect tough - the JS library we used for the tree-like graph kinda sucked and we only learned about it halfway through the process and the interface could use a facelift to make it less of a hassle to use. Also, there were some unforeseen complications (one of the developer's girlfriend broke her leg and had to be taken to a hospital) but I like the end product of our struggle.

If you want to help us, you can vote for Gilgamesz.

All you need is a Twitter account, simply visit Rails Rumble website, log-in using the yellow button at the left-top corner of the screen and then click Favourite. Do it if you want to make a group of Rails nerds happy :D