Slavko Pesic's Blog

Drupal 7 Views Preview Shows Different Results

OK, so you are a site builder or a privileged role building a view. In the preview you see a certain result set, but regular and/or anonymous users see only subset of those results or no results at all.

By Slavko Pesic, Engineering Team Lead
February 24, 2015

Javascript WAT: Diving into ECMAScript Abstract Equality Comparison Algorithm

I'm assuming most of you saw Gary Bernhardt's talk from CodeMash 2012 on some WAT™ features in Ruby and JavaScript. If not, I highly recommend you do as it's thouroughly amusing. No, seriously. Go ahead, I'll wait...

By Slavko Pesic, Engineering Team Lead
October 29, 2014

Drupal 7 Form API: Using #states with multiple conditionals (AND, OR and XOR)

I've been playing with D7 forms lately and have found #states to be somewhat challenging due to lack of documentation on Form API page.
I've poked around a bit and decided to write a blog with my findings in case someone else is in need of this info down the road.

By Slavko Pesic, Engineering Team Lead
August 14, 2014

Javascript: Understanding Objects vs Arrays and When to Use Them. [Part 2]

In Part 1 of this blog post I omitted one very important detail about the nature of Arrays. You might have heard this already: "Everything is an Object in javascript!". This is technically true. While String, Bool and Number are literals, javascript silently creates a wrapper Object around the primitive at the time of access. There are couple of other special data types that are not Objects (i.e. Undefined and Null), but for the most part you will be dealing with "things" that inherit from the Object prototype.

By Slavko Pesic, Engineering Team Lead
June 5, 2014

Javascript: Understanding Objects vs Arrays and When to Use Them. [Part 1]

See Part 2 here

What are Objects and how do they differ from Arrays in Javascript?
When is it advantageous to use one over the other?

I ran into this question several times while browsing through stackoverflow's javascript queue so I decided to recycle my answers, elaborate a bit and make it into a blog post. If you are new to javascript, understanding these two data types is very important and could potentially save you some headache down the road.

Declaration & Augmentation

By Slavko Pesic, Engineering Team Lead
June 5, 2014

Writing a simple Sublime Text plugin.

For the most part I like to keep my code editors as light and vanilla as possible. Some of the basic features that I like to see in my editor include auto indentation, syntax highlighting and ability to search across the project. Anything that will help debugging my codebase is a plus. Sublime Text offers all of these features out of the box and much more with the addition of community contributed plugins.

By Slavko Pesic, Engineering Team Lead
March 7, 2013

How To Detect Which Element Was Clicked, Using jQuery

Sometimes we would like to find out which particular element (or set of elements) has user clicked on. However, binding click events on each element manually might not be the most practical way of accomplishing this. Or we might want to fire a certain event if user clicks on anything but particular element(s). I will describe one of such scenarios below and offer one of possible solutions to it using jQuery.

By Slavko Pesic, Engineering Team Lead
October 9, 2012

How I got Twitter, UNIX Timestamps, and Drupal 7 to all play nice

Recently I had an opportunity to work with Twitter module for Drupal 7 on one of the projects. Most of the functionality I needed for the project was already available within the module and with few tweaks here and there I can get the task done.

By Slavko Pesic, Engineering Team Lead
August 2, 2012

Ready for transformation?