Javascript Flatten an n-dimension array iteratively and recursivley

Author Archives: admin

Javascript Flatten an n-dimension array iteratively and recursivley

Just in case you need to know Recursively, although a tad more elegant this will blow your stack up until ES6 var data = [ 1, [ 2, 3 ], [4, [ 5, [ 6, 7 ], 8 ], 9] … Continue reading

Posted in Uncategorized | Leave a comment

Install Laravel Spark on C9.io workspace

Hope this helps, after two days of toil I finally got a spark project up on a c9.io workspace here are the steps I took. This assumes you have already bought a Spark license at https://spark.laravel.com/ Create the c9 workspace. Because … Continue reading

Posted in Uncategorized | Leave a comment

Check if images exist before rendering with Javascript and jQuery

Recently I ran into a problem where I was making a bunch of Facebook Graph API requests for Facebook Events in order to build an Events widget. Problem was, after receiving data from the API, some Event objects had a … Continue reading

Posted in Uncategorized | Leave a comment

Template Tag Polyfill for Internet Explorer

Have you used the HTML5 template tag? I have too. Seems like a really great idea, until. until QA tests your project and you realize it won’t work in IE. Better yet, not just IE 7 or 8, all versions … Continue reading

Posted in Uncategorized | Comments Off on Template Tag Polyfill for Internet Explorer

Print only lightbox or modal window content

This was a real kick in the Jimmy. On a recent project I had a requirement to print contents of a modal window. Solution: When the user clicks a print button add an iframe to the end of the body … Continue reading

Posted in Javascript, Uncategorized | Leave a comment

Facebook profiles vs. pages and graph api data retrieval

Help! My Facebook plugin doesn’t retrieve any data! The problem may be you are trying to retrieve data from a Facebook profile rather than a Facebook page. Facebook puts much tighter restrictions on data its Graph API makes available to … Continue reading

Posted in jQueryFacebookWall, Uncategorized | Leave a comment

Javascript return focus to parent tab

This one took me a bit. I was creating a new tab on form submission. If a user clicks a button on the new tab, focus had to be shifted back to the parent tab. If the form was submitted … Continue reading

Posted in Uncategorized | Leave a comment

JavaScript Reg-ex for sub-domain name

This one took me a bit so thought it might be worth writing it down. If you need to validate a field for a valid subdomain name, ie the “subdomain.inthedomain.com” you have a couple of requirments: 1) Field value starts … Continue reading

Posted in Javascript | Comments Off on JavaScript Reg-ex for sub-domain name

Sorry to all the fans

Ladies and gentleman all my blog posts have left the building. I used to use this thing as a way to remeber all the development stuff I couldnt remeber. I ditching that idea. Instead of  all the old unix commands, … Continue reading

Posted in jQueryFacebookWall, Uncategorized | Comments Off on Sorry to all the fans