February 2012
2 posts
Some different ways of reversing a string in PHP &...
I was looking at some of the different ways of reversing a string in PHP and in JavaScript. There are so many ways of accomplishing such a simple task but I wanted to compare some of the different ways.   PHP $string = “This is a test”; strrev() $string = strrev($string); This is almost cheating because PHP has a built in function… but this is the easiest way for sure Array...
Feb 16th
8 tags
Feb 15th
January 2012
9 posts
2 tags
JavaScript Weirdness
I was just listening to the lightning talk by Gary Bernhardt from CodeMash 2012 and he brought up some really interesting (and funny) points about JavaScript. For example: [] + []; ”” {} + {}; NaN [] + {}; [object Object] {} + []; 0 So why is it that if you add two empty Arrays you get an empty string, but if you add two objects you get “not a number”. Array +...
Jan 27th
1 note
6 tags
JavaScript: Clock Angle Problem
Earlier today I was presented with the problem of calculating the degrees between the hour hand and the minute hand of an analog clock. At first this seemed like a fairly complicated task, however after playing with it for a bit the solution became apparent. But now after looking up the answer on Google I feel really embarrassed on how easy the solution really is. It’s amazing how...
Jan 27th
12 tags
Socialite.js →
JavaScript for implementing social sharing buttons asynchronously. Support for Twitter, Google+, Facebook and LinkedIn
Jan 24th
7 tags
Jan 23rd
4 tags
Jan 20th
1 note
8 tags
Selectable Table Rows with Keyboard Navigation
Recently I was working on a project where we needed to display a multi-select input. Very quickly it became apparent that the traditional select box would not work since the information we were presenting would need to be displayed in multiple columns and support pagination. The common sense answer was to display the information in a table however after some searching I realized there were no good...
Jan 18th
17 notes
Jan 17th
6 tags
Jan 16th
6 notes
“Character is not made in a crisis, only exhibited”
Jan 10th