Category: "Development"

  • Front-end Job Interview Questions

    Posted: Feb 9, 2012 7:16 pm 49 Comments

    A while ago, a group of very intelligent and experienced Front-end Developers got together and created a list of great Front-end focused job interview questions. This group consisted of @bentruyman,@ajpiano, @paul_irish, @SlexAxton, @boazsender, @miketaylr, @iansym, @vladikoff and @gf3. Since it’s creation, I’ve expanded to this list and happen to use it to help friends prepare [...]

  • Quick Tip: Get Gravatar Images from Emails with JavaScript

    Posted: Dec 6, 2011 9:30 am 3 Comments

    A quick video tutorial on how to get Gravatar images, from emails, with JavaScript. We get some nice help from Chris Coyier’s (http://css-tricks.com/ & http://digwp.com/) MD5 Library. Final Code Example

  • Using jQuery Deferreds with Animations

    Posted: Dec 5, 2011 9:30 am 1 Comments

    I try and hang out in the #jQuery IRC Channel whenever I’ve got some time and I see a lot of the same questions. One of those, which I see fairly often, is: “How do I run some code once my animations ar finished?”. The simple answer would be to add a callback function to [...]

  • Live vs. Static Node Lists

    Posted: Sep 28, 2011 7:30 am 2 Comments

    A little while ago, I was working on an application where I wanted to cache collections of elements to save on DOM traversals / improve performance. The problem with caching a collection of elements is that you’ll, in most cases, store a static node list. Thus, when new elements are introduced to the DOM, that [...]

  • Getting a clean document or window Object in JavaScript

    Posted: Jul 15, 2011 6:24 pm 2 Comments

    Most JavaScript libraries and plugins have now implemented a form of protection against carless remapping of native methods. Protoype.js itself used to do this kind remapping/modification, which they’ve now changed. That said, there’s still a very real possibility, as a library or plugin, that your script will be run in an environment not carefully maintained [...]

  • Add support for nth-of-type(), and more, in jQuery

    Posted: Jun 8, 2011 2:41 am 3 Comments

    By default, jQuery doesn’t support the nth-of-type() CSS selector out of the box (you can read more about why in the post by John Resig titled Selectors that People Actually Use). This was definitely an issue for me as I began to write more and more verbose HTML templates with less helper classes that normally [...]

  • Caching within your Javascript Applications

    Posted: Jun 8, 2011 2:30 am 0 Comments

    It’s important to remember that writing good Javascript includes writing scalable Javascript. Little optimizations can always be implemented and best practices are good to keep in mind. Training yourself to write code like this can be a bit tasking but I promise, you’ll really enjoy doing things like caching and optimizing selectors once you’ve begun. [...]

  • Get Image for Youtube or Vimeo Videos from URL

    Posted: May 16, 2011 8:20 pm 5 Comments

    When you’re building social applications it’s always a good idea to include context relevant to certain information. This helps tie the experience together and makes things a lot nicer for the user. I find myself working on projects that need some sort of relevant screen shot of either the site or video someones linked to. [...]

  • Strip out text between two tags in a string – PHP

    Posted: Apr 26, 2011 4:15 am 0 Comments

    If you’re not a REGEX (Regular Expression) mastermind it can be hard to use something like PHP’s preg_match() function which is very useful for obtaining the code contained within the selector given. That said, years ago, before I knew any Regular Expressions I wrote a handy strip function that will find the content contained between [...]

  • Randomly Generate Strings – PHP

    Posted: Apr 5, 2011 6:23 pm 1 Comments

    There’s going to come a time when you need to create a random string of some kind. Whether to be added as a salt for password encryption or for use as a generated password itself. Using numbers letters and special characters means a greater selection and number of combinations possible. To be exact the snippet [...]

  • Animating Colors with jQuery

    Posted: Apr 5, 2011 6:07 pm 3 Comments

    Have you ever tried to animate the color of an elements background, border or text in jQuery and it doesn’t work? For some reason jQuery has not implemented native color animations. That said, John Resig himself made a color plugin long ago that enables color animations in jQuery. Using this plugin we are now able [...]

  • Make Text URLs Active – Javascript/jQuery

    Posted: Apr 5, 2011 5:31 pm 1 Comments

    I’ve come across this many times where I want to be able to turn static text URL’s into active HTML links with Javascript. A long time ago I came across a script for it and have been using it alongside jQuery. The solution is essentially using some good old Javascript and Regular Expressions. Here’s the [...]

  • Animate float positions in jQuery 1.5

    Posted: Feb 23, 2011 5:54 am 1 Comments

    The question of how to animate an element using floats, or floated elements (ie. float: left, float: right), was posed on Quora the other day and it inspired me to make a quick plugin to achieve this simple task. Out of the box jQuery doesn’t support animating a float postion to the right or left; [...]

  • Javascript Applications 101

    Posted: Jan 24, 2011 9:32 am 6 Comments

    One of my favorite things to do is to build Applications and their inner workings. Scalability and robustness are two things I keep in mind when beginning development. Javascript has become the “go-to” language for Application development these days so it’s important to get a good understanding of how to develop a good base for [...]

  • Fix jQuery’s animate() to allow “auto” values

    Posted: Jan 14, 2011 7:13 pm 4 Comments

    Going through the jQuery source you start to learn how things are processed by the library. A few months ago I noticed that the .animate() method wasn’t able to compute “auto” values for elements and animate accordingly. After Google-ing the issue I noticed that it’s a big issue for some people. This past month I [...]

  • Using anonymous functions with WordPress’ add_action

    Posted: Jan 13, 2011 2:50 am 5 Comments

    Many of my WordPress developer counterparts come from a long background of non-development related work. Most of which have only been introduced to PHP as a programming language in order to better understand how their WordPress site functions. With this in mind you tend to find a lot of redundancy and, in many cases, unnecessary function [...]

  • Library Agnostic Pub/Sub (Publish / Subscribe)

    Posted: Nov 1, 2010 7:23 am 4 Comments

    Update: Since writing this post I’ve started using a modified version of Peter Higgens jQuery specific pub/sub solution. Here’s the updated version I’m using now, along with an App namespace: App = {}; App.cache = {}; App.publish = function(topic, args){ App.cache[topic] && $.each(App.cache[topic], function(){ this.apply($, args || []); }); }; App.subscribe = function(topic, callback){ if(!App.cache[topic]){ [...]

  • Find elements that don’t contain a string

    Posted: Oct 27, 2010 9:06 pm 0 Comments

    I had an issue the other day with finding an element that didn’t contain a certain “string”. If you’ve never heard about the jQuery filter :contains you may be unaware that you can find an element based on if it contains a certain string.

  • Animating & sorting elements using $.sortGrid()

    Posted: Oct 19, 2010 2:39 am 1 Comments

    About a month ago I stumbled upon http://www.builtbybuffalo.com/ and was inspired by their presentation of case studies / past work. I decided to work on a plugin that would mimic their great functionality found on their “work” page. The plugin $.sortGrid() allows you to sort elements based on a specified class.

  • Detect Attribute Changes with jQuery

    Posted: Oct 6, 2010 3:36 pm 12 Comments

    One of the biggest issues I’ve come across, in my recent run in’s with event driven Javascript programming, is tracking attribute changes in the DOM. A good example of what I’m talking about would be: When my <p> tag has it’s background color changed to red.

  • Master jQuery Event Triggers

    Posted: Sep 9, 2010 5:41 pm 1 Comments

    Some of the simplest seeming jQuery code can wreak the most havoc. Most notably, relying on certain triggers to be invoked can be detrimental when dealing with dynamic content. A perfect example of this is when you are dynamically creating content that is then meant to have some kind of dynamic functionality attached to it.

  • PHP Recursive Find and Replace

    Posted: Aug 4, 2010 6:46 am 8 Comments

    If you’ve ever worked with the str_replace() function in PHP you may or may not have come across the issue with it not recursively looping through arrays. I recently came across this issue when having to deal with a multi-dimensional array that I needed to have scrubbed for certain values. Here’s the quick code snippet [...]

  • Quick jQuery/AJAX Tip

    Posted: Jul 12, 2010 6:52 am 1 Comments

    Pulling your JSON data from a file is a pretty straight forward process. Usually most of my AJAX requests are run through jQuery’s shorthand $.get() or $.post() functions. What I’ve come across, many times, is that these functions allow me to write my requests fast enough that I end up forgetting to declare my expected [...]

  • jQuery Collapsing Nav

    Posted: Jun 28, 2010 6:51 am 2 Comments

    I’ve used this same technique a few times across a couple projects now. jQuery collapsable navs are all around the internet so if you’ve already seen 3-4+ you’re probably not going to encounter anything new here.

  • Simple PHP Cookie-based Login

    Posted: Apr 26, 2010 6:47 am 0 Comments

    I wrote an extremely quick and simple PHP based login script a few years back for some peers. It uses some basic methodology and cookies to authenticate. You can easily modify this script to use sessions, protect against cookie tampering, or add a salt to the encrypted password.

"w3fools.com - because friends don't let friends use w3schools" ~ dan heberden
themify
Learning JavaScript