Tag IT
The Truth About Gemspecs
There are still many folks who know shit about gemspecs, who misunderstand what gemspecs are good for or don't have a clue how to work with them. So let me explain to you and show some tricks how to use them effectively.
Why I Prefer MooTools over jQuery
I don't understand the hype behind jQuery, why is everyone so excited about it. I'm not. Let's go through the typical jQuery marketing bollocks(TM):
I'm So In Love with Enumerable#inject
Enumerable#inject is the most flexible method for iterating collections with awesome possibilities. Let's take a look on some examples where it actually fits better than other Enumerable methods.
Prototype Inheritance in JavaScript
Old-school way how to handle inheritance in JavaScript is so-called prototype inheritance. A lot of people don't very understand how it actually works. This technique works only with objects, there isn't anything like classes.
Asynchronous Testing with Node.js
Do you remember projects when your tests run for 30 minutes or even an hour? I do, actually it's nearly turning into a standard. So when CI send you notification that something went wrong, you are already working on a new task, so you have to switch context to fix the stupid bug and then switch context back ... pretty annoying and distracting. Fortunatelly it doesn't have to be so slow, mainly in a web application when you can make a lot of code to run asynchronously since you are always waiting for database ...
Wake up guys, Ruby 1.9 is here!
I'm disappointed how slowly Ruby community adopts the new Ruby 1.9. Oh wait, it's not new at all, it's more than a year old now! There is still significant amount of gems which aren't 1.9-compatible, my collegueues are asking me why we should upgrade to Ruby 1.9 and for Rubinius core team has compatibility with 1.9 so low priority that they didn't accept my patches for 1.9 compatibility even if I asked then 3 times.
My Node.js Projects
Minitest.js in action (it's using colours.js):
Why You Don't Need OOP in JavaScript (So Much)
After I did some research on OOP in JavaScript, I realized I don't need it so much. I'm used to do pretty much everything via OOP, since it's the way how Ruby, my primary language works. But JavaScript is different.
CommonJS Module System in Ruby
I really like the CommonJS module system, which is explicit, rather than implicit as Kernel#require in Ruby. So rather than putting everything into the global namespace, require in CommonJS simply returns an object which contains the stuff you explicitly exported from the required file. For example:
Subdomains in Django: An Example
In Django Middleware is a class which respond to one of these methods: process_request, process_view, process_response or process_exception. For more informations see the Django middleware docs.
Prototype inheritance in JavaScript II
This article is an continuation of the Prototype Inheritance in JavaScript where I explained what is prototype and how the basics of prototype inheritance in JavaScript works. Today I'll go on with the new keyword and how to use the more advanced OOP techniques as super() etc.
WSGI & Django Applications on Passenger
Quite cool thing I discovered recently is that you can deploy WSGI applications (Django etc) on Passenger. There is an example app for WSGI out there. Similarly as in Ruby, you have which looks like this (it's a slightly modified version of the linked example):
config.ru passenger_wsgi.py
Extending JS Prototypes in Non-Invasive Way
The most serious reason for not extending prototypes of things like Object or Array is that you'll break iterations. For example
Mixins in JavaScript
Thanks to JavaScript flexibility it's incredibly easy to use mixins:
DRY Your YAML Files Up!
It's basically a simple inheritance pattern in YAML:
HTML 5 Review
For a looong time there hasn't been any development of the HTML standard. HTML 4 was released in December 1997, with few minor updates since then. Finally in recent years a lot of people realised that the current HTML 4 standard isn't enough for needs of the modern web development and since the situation in W3C has been complicated, the Web Hypertext Application Technology Working Group ( WHATWG) started to work on a new standard ...
Meet Ace a New Static Site Generator
Ace is a powerful tool designed to easily generate even complex web sites. I used to use Nanoc, but it doesn't work well for the complex stuff. Neither does Webby.
Pending Examples via NotImplementedError in rSpec
NotImplementedError can be sometimes really helpful. Unfortunately rSpec shows them as a failure, but aren't they just the exact equivalent of a pending message?
My Presentations about Freelancing & Messaging
Currently I'm on visit in Czech Republic where I'm originally from and I'm doing some talks in here. I talked about freelancing for Prague Ruby group and for TechSpring in Olomouc and about messaging for Masaryk university.
Padrino and Template Inheritance
Rango was the first framework supporting template inheritance in Ruby. Now thanks to the template-inheritance gem and its new Padrino adapter you can have all the inheritance goodies in Padrino!
Custom Gems in Gemfile
Switching between your custom libraries from your local directory and from RubyGems.org can be a real pain. Fortunately with Bundler it's getting much easier.