<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>I’m an internet entrepreneur, web developer, designer, lover of Jesus from San Diego. Originally from Sweden. I have a beautiful wife, and two amazing kids.</description><title>Nathan Firth</title><generator>Tumblr (3.0; @nathanfirth)</generator><link>http://nathanfirth.com/</link><item><title>Some different ways of reversing a string in PHP &amp; JavaScript</title><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PHP&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$string = “This is a test”;&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;strrev()
&lt;pre class="brush: php; toolbar: false;"&gt;$string = strrev($string);&lt;/pre&gt;
This is almost cheating because PHP has a built in function… but this is the easiest way for sure&lt;/li&gt;
&lt;li&gt;Array Reverse
&lt;pre class="brush: php; toolbar: false;"&gt;$string = implode('',array_reverse(str_split($string)));&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;For Loop
&lt;pre class="brush: php; toolbar: false;"&gt;$string = str_split($string);
for ($i=count($string)-1; $i&gt;=0; $i--) {
    $newstring .= $string[$i];
}
$string = $newstring;
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;var string = “This is a test”;&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;String Split Reverse Join
&lt;pre class="brush: js; toolbar: false;"&gt;string = string.split('').reverse().join('');&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;For Loop
&lt;pre class="brush: js; toolbar: false;"&gt;var newString = [];
for (i=(string.length)-1; i&gt;=0; i--) {
    newString.push(string[i]);
}
string=newString.join('');
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;</description><link>http://nathanfirth.com/post/17679400036</link><guid>http://nathanfirth.com/post/17679400036</guid><pubDate>Wed, 15 Feb 2012 15:25:00 -0800</pubDate></item><item><title>Pulled out the old Streeboard out of the closet and pulled a 540...</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/YAUmGaYv-RM?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Pulled out the old Streeboard out of the closet and pulled a 540 at the skatepark down the street. That’s pretty good for me considering I haven’t stood on a Streetboard in years.&lt;/p&gt;</description><link>http://nathanfirth.com/post/17622073098</link><guid>http://nathanfirth.com/post/17622073098</guid><pubDate>Tue, 14 Feb 2012 13:56:50 -0800</pubDate><category>streetboard</category><category>snakeboard</category><category>dimension</category><category>540</category><category>skateboard</category><category>trick</category><category>air</category><category>streeboarding</category></item><item><title>JavaScript Weirdness</title><description>&lt;p&gt;I was just listening to the &lt;a href="https://www.destroyallsoftware.com/talks/wat" title="lightning talk by Gary Bernhardt"&gt;lightning talk by Gary Bernhardt&lt;/a&gt; from CodeMash 2012 and he brought up some really interesting (and funny) points about JavaScript.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre class="brush: js; toolbar: false;"&gt;[] + []; &lt;/pre&gt;
&lt;p&gt;””&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre class="brush: js; toolbar: false;"&gt;{} + {};&lt;/pre&gt;
&lt;p&gt;NaN&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre class="brush: js; toolbar: false;"&gt;[] + {};&lt;/pre&gt;
&lt;p&gt;[object Object]&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre class="brush: js; toolbar: false;"&gt;{} + []; &lt;/pre&gt;
&lt;p&gt;0&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;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 + Object is an Object but Object plus Array is 0???&lt;/p&gt;</description><link>http://nathanfirth.com/post/16585252398</link><guid>http://nathanfirth.com/post/16585252398</guid><pubDate>Fri, 27 Jan 2012 09:51:00 -0800</pubDate><category>javascript</category><category>weirdness</category></item><item><title>JavaScript: Clock Angle Problem</title><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;It’s amazing how complicated you can make a solution, when most of  the time it can be solved so easily once you have the basic logic worked  out.&lt;/p&gt;
&lt;p&gt;Solution:&lt;/p&gt;
&lt;pre class="brush: js; toolbar: false;"&gt;// h = 1..12, m = 0..59
function angle(h,m) {
hAngle = 0.5 * (h * 60 + m);
mAngle = 6 * m;
angle = Math.abs(hAngle - mAngle);
angle = Math.min(angle, 360 - angle);
return angle;
}
&lt;/pre&gt;</description><link>http://nathanfirth.com/post/16570142471</link><guid>http://nathanfirth.com/post/16570142471</guid><pubDate>Thu, 26 Jan 2012 23:36:00 -0800</pubDate><category>JavaScript</category><category>Math</category><category>angle</category><category>clock</category><category>clock angle problem</category><category>problem</category></item><item><title>Socialite.js</title><description>&lt;a href="http://www.socialitejs.com/"&gt;Socialite.js&lt;/a&gt;: &lt;p&gt;JavaScript for implementing social sharing buttons asynchronously. Support for Twitter, Google+, Facebook and LinkedIn&lt;/p&gt;</description><link>http://nathanfirth.com/post/16365740504</link><guid>http://nathanfirth.com/post/16365740504</guid><pubDate>Mon, 23 Jan 2012 13:23:56 -0800</pubDate><category>social</category><category>sharing</category><category>socialite.js</category><category>socialite</category><category>javascript</category><category>jquery</category><category>js</category><category>plugin</category><category>facebook</category><category>twitter</category><category>google+</category><category>linkedin</category></item><item><title>The wooden spoon trick is even funnier in Icelandic. Friggin...</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/TXPQY_VRP6M?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The wooden spoon trick is even funnier in Icelandic. Friggin hilarious!!!&lt;/p&gt;</description><link>http://nathanfirth.com/post/16364065481</link><guid>http://nathanfirth.com/post/16364065481</guid><pubDate>Mon, 23 Jan 2012 12:58:03 -0800</pubDate><category>woode</category><category>spoon</category><category>trick</category><category>prank</category><category>funny</category><category>video</category><category>wooden spoon</category></item><item><title>Wow just wow! This video makes me wanna go snowboarding soo bad...</title><description>&lt;iframe src="http://player.vimeo.com/video/34959402?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Wow just wow! This video makes me wanna go snowboarding soo bad right now. But seriously when did snowboarding get this crazy???? Riders: Nick Dirks and Jed Anderson&lt;a href="http://www.awsm.com/10443/jed-andersonnick-dirks-the-re-edit/" rel="bookmark" title="Permalink to Jed Anderson/Nick Dirks: The Re Edit"&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://nathanfirth.com/post/16174930426</link><guid>http://nathanfirth.com/post/16174930426</guid><pubDate>Fri, 20 Jan 2012 08:40:42 -0800</pubDate><category>snowboarding</category><category>snowboard</category><category>nick dirks</category><category>jed anderson</category></item><item><title>Selectable Table Rows with Keyboard Navigation</title><description>&lt;p&gt;&lt;img alt="Selectable Table Rows with Keyboard Navigation" height="257" src="http://images.nathanfirth.com/jquery.jpg" width="600"/&gt;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 plugins for selecting multiple table rows. The other requirement was to duplicate the functionality of a drop down and add in keyboard controls (shift click, ctrl click, etc.) so I set out to write my own.&lt;/p&gt;
&lt;p&gt;So far I’m pretty happy with it, there are still some issues I need to work out but for the most part it’s a solid plugin. The plugin itself adds just the ability to select table rows with keyboard controls… however how that data gets there, or what you do with that information is up to you. I’ve added support for three callbacks:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;on select (single click)&lt;/li&gt;
&lt;li&gt;double click (or “Enter” key)&lt;/li&gt;
&lt;li&gt;on change&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;And it supports the following keyboard controls:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Ctrl + Click&lt;/li&gt;
&lt;li&gt;Shift + Click&lt;/li&gt;
&lt;li&gt;Shift + Ctrl + Click&lt;/li&gt;
&lt;li&gt;Shift + Up|Down Keys&lt;/li&gt;
&lt;li&gt;Up|Down Keys&lt;/li&gt;
&lt;li&gt;Enter (to select)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;It is now available on GitHub: &lt;a href="https://github.com/nathanfirth/jQuery-Selectable-Table-Rows" title="https://github.com/nathanfirth/jQuery-Selectable-Table-Rows"&gt;&lt;a href="https://github.com/nathanfirth/jQuery-Selectable-Table-Rows"&gt;https://github.com/nathanfirth/jQuery-Selectable-Table-Rows&lt;/a&gt;&lt;/a&gt;.&lt;strike&gt; I’ll be uploading it to GitHub in the next day or so.&lt;/strike&gt; I would love to get some feedback. Please check out the demo here: &lt;a href="http://dev.nathanfirth.com/jquery-tableselect/" title="http://dev.nathanfirth.com/jquery-tableselect/" target="_blank"&gt;&lt;a href="http://dev.nathanfirth.com/jquery-tableselect/"&gt;http://dev.nathanfirth.com/jquery-tableselect/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://nathanfirth.com/post/16027329916</link><guid>http://nathanfirth.com/post/16027329916</guid><pubDate>Tue, 17 Jan 2012 14:53:00 -0800</pubDate><category>jquery</category><category>plugin</category><category>jquery plugin</category><category>table rows</category><category>selectable table rows</category><category>keyboard controls</category><category>keyboard navigation</category><category>jquery tables</category></item><item><title>Alright, the video I shot and edited for @robcarona has finally...</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/c8K5sLyeaLo?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Alright, the video I shot and edited for @robcarona has finally been released.&lt;/p&gt;</description><link>http://nathanfirth.com/post/16017677349</link><guid>http://nathanfirth.com/post/16017677349</guid><pubDate>Tue, 17 Jan 2012 11:51:09 -0800</pubDate></item><item><title>This past weekend was a lot of fun, I had the opportunity to...</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_lxwozsOzXm1r9hxkro1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This past weekend was a lot of fun, I had the opportunity to film and edit the music Video titled “Beautiful” for Rob Carona. It’s the first time I’ve had the opportunity to create a music video, and as a web developer the opportunities to explore other forms of creative expression are not as frequent as I would like. The shoot itself could have been better coordinated, as we did not have a story board and most of the shots where rather spontaneous. However, I don’t think you will be able to tell from looking at the video. I think it turned out excellent for a video that was shot, edited and produced in less than two days. I’m still recovering from the lack of sleep, but it was a very rewarding experience and look forward to doing it again sometime.&lt;/p&gt;
&lt;p&gt;I will post the link to the YouTube video shortly.&lt;/p&gt;</description><link>http://nathanfirth.com/post/15960421509</link><guid>http://nathanfirth.com/post/15960421509</guid><pubDate>Mon, 16 Jan 2012 11:33:00 -0800</pubDate><category>rob carona</category><category>music video</category><category>canon 7d</category><category>music</category><category>band</category><category>video shoot</category></item><item><title>"Character is not made in a crisis, only exhibited"</title><description>“Character is not made in a crisis, only exhibited”</description><link>http://nathanfirth.com/post/15596348137</link><guid>http://nathanfirth.com/post/15596348137</guid><pubDate>Mon, 09 Jan 2012 17:49:19 -0800</pubDate></item></channel></rss>

