package playne

imports "programmer"

Category: Web Dev

  • rails generate Could not find <gem> in any of the sources

    So with my latest project I am using Rails 4.1 – this is all well and good, but here is a gotcha. there is a thing called spring that is supposed to make things faster – except when it gets in the way! tl;dr – killall spring So – here are the symptoms $ rails…

  • Rails, CanCan and Best In Place editing

    So here is a little gotcha and solution when using CanCan and Best In Place. With the default setup, if CanCan auth fails on a best in place edit you get a redirect to your default “Auth Failed” path and that page then tries to render as javascript. that does not work all that well!…

  • Adventures with Google Content API and OAuth

    So recently I have had the opportunity to play with Google’s Content API and their OAuth API. I have needed to use it in “offline” mode, as I want to interact with Google when the authorising user is not present (cron jobs and such). Here are my lessons learnt. You can Indeed use OAuth on…

  • Well Done Opera

    So I got this funny dialog from Opera today 🙂

  • PHP: for vs foreach

    So this week I was asked the question on which was quicker in PHP – A for loop or a foreach loop. It turns out that my assertion that they were both about the same performance was about right. Here are my test results jason@server:~/php$ php speedtest.php Starting test: Test for loop data length=4000000 Mem:…

  • WordPress – Stop screwing with the timezone!

    So my dates were not displaying correctly and it turns out that WordPress is to blame. After checking the data and finding that it was correct, I was confused as to why a wordpress page was displaying the wrong date for a correct unix timestamp. WordPress was screwing with the timezone setting of PHP. This…

  • HTML5 input type=”number” and step granularity

    or how I learnt the hard way about the how the step attribute works. Being an old (VB4,5,6) windows developer, I mistook the “step” attribute on the <input type=”number”…/> HTML 5 element for what it used to be. It not only controls what the step is if you press the spin control but also defines…

  • wpsc_update_custom_meta() nukes my custom post meta data

    So today I was rather perplexed as to why my custom meta box on my post edit page was not playing ball. It would be set to a value and always stay at it, delete it from the database and give it a different value – and it would keep that too.St Since I had…

  • WordPress, WP E-Commerce and the lack of ASYNC AJAX

    Now Normally the A in AJAX means Asynchronous, meaning you can have several requests going at once, so it was very confused as to why my AJAX wasn’t. My WordPress plugin is a long running import process and I decided to use AJAX so that I can provide timely feedback to the user as to…

  • Handy Tip: Using a proxy to request a website from a specific server

    So, I have been trying to figure out how to request a specific website from a given server (ip address) and today it finally dawned on me that I can use a proxy server to do this! In chrome I am using the “Switchy” extension, in Firefox I use “Proxy Selector” and set the proxies…