Home » Blog » Archive by category 'Coding'
Browsing articles in "Coding"

Raspberry Pi 2 – You Gotta Try This

Apr 29, 2015   //   by David   //   Blog, Coding  //  No Comments

So I’m a programmer at heart. It’s been a long time since I sat down and coded something from start to finish. In my early days I wrote large scale custom Client Management Systems with multiple database linking and huge data mining elements…and I loved it. Nowadays it’s website development, small WordPress plugins and auditing sites for usability and performance which I also love. That said, I still have a desire to tinker with technology.

Years ago I saw the introduction of the Raspberry Pi and thought it was a great little rig for getting kids into technology. They could buy a base unit for cheap and just create stuff, share stuff and have fun with it. Of course, it was so much more than that and the Pi community created (and shared) some amazing, low-cost uses.

Pi2B

This year the Raspberry Pi had an update — a major update — making it a pretty powerful little device. The specs are all here, but what I will say is that has moved from novelty tech into a realm of media servers, NAS controllers and, well, a multitude of cool projects.

This upgrade finally convinced me to buy one. I had a specific use in mind — to replace my aging PC as a media server — and a local shop started selling them. I decided to go with a bundled XBMC media server kit containing a Raspberry Pi 2, case, XBMC preinstalled SD card, power adapter and HDMI cable.

As I waited for it to arrive, I began surfing the Pi project sites, reading review and performance data and generally making myself more impatient. When it arrived, I had these amazing ideas about what I wanted to do, all the code I could write and the neat projects my son and I could do but what happened was, I put it together, plugged it in and it just worked. My XBMC media server was up and running in a matter of minutes. Moved some files around and done. I turned off my old media server PC and there was silence. This little Raspberry Pi was quietly going along doing exactly what I wanted it to do.

I realised that I wouldn’t get the chance to work on the amazing projects, mess around with command line coding and it was a little anti-climatic. Don’t get me wrong, the Pi is awesome. It has replaced a power hungry tower PC that created far too much noise polution in my home office but, because of that, I can’t really play on it. Sure, it’s easy to have another SD card with a totally different operating system and I can code/recode to my heart’s content but since it’s the family media server it stays in that role.

I’m pretty sure I’m going to buy another one just to mess with and do things like create a retro gaming console. 😉

Stay tuned as I’m going to post more Raspberry Pi related articles, links and even some cool accessory reviews. If you’ve got one, please post in the comments what you are using it for.

And for my US friends interested in picking this up Amazon often has specials.

Any Topic Suggestions?

Nov 25, 2014   //   by David   //   Blog, Coding  //  No Comments

It’s been a while since I posted anything here on my blog, not for lack of interest on my part, but lack of direction. If there are any topics that you folks might be interested in feel free to make your suggestions in the comments section here.

WordPress and GZIP Compression

Jul 10, 2013   //   by David   //   Blog, Coding  //  No Comments

Do you have access to your .htaccess file and want an immediate improvement in your WordPress site’s performance?

Simply add the following code below the # END WordPress to tell your server to send compressed data to the browser when pages are requested. Only textual data is compressed like HTML, PHP, CSS, Javascript, etc. For images you should already be uploading properly sized and compressed files.


# BEGIN GZIP

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript

# END GZIP

Now, I’m not going to go into the details of FTPing, backing up and editing the file — if you don’t know how to do it, please consider asking someone who does because messing up this file can and will take down your site.

Once you’re done, check to see if it worked.
http://www.whatsmyip.org/http-compression-test/

HTML5 Audio with Fallback in WordPress

Apr 19, 2013   //   by David   //   Blog, Coding  //  4 Comments

I’ve written a couple articles and some code for dealing with audio files in WordPress and on iOS devices. The hope was that I could use html5 audio whenever it’s supported with a fallback to my favorite audio player.

It looks like we are almost there. With JetPack installed all you need to do to get HTML5 audio is use the audio shortcode
Read more >>

The State of HTML5 Video

Jan 30, 2012   //   by David   //   Blog, Coding  //  No Comments

Excellent article by LongTailVideo on current (Jan 2012 article, Nov 2011 data) support of HTML5 video features on various devices and browsers.

Keep in mind that this is specific research and should be balanced using your own site analytics (eg. Your site gets mostly Firefox traffic vs IE you can move towards certain features sooner).

http://www.longtailvideo.com/html5/

QR Codes and vCards

Jan 11, 2012   //   by David   //   Blog, Coding  //  1 Comment

While playing around with QR Codes as discussed here and here I found myself wondering if I could throw together a dynamic QR Code for creating a vCard. The answer was yes. With a couple small caveats, it looks ugly and I’ve tested it but you need to test it yourself before publishing the QR Code, I’m pretty happy with the results.

I did find that my favorite QR Scanner I use on my iPhone was one of the many that suffers from poor vCard support so data was getting put in the wrong fields. Once I tried QRafter (vCard support is good, but I’m still not sold on the rest of it) I was able to properly test the images.

Feel free to give it a try, right-click on the preferred image to save and post your comments or feedback here. I get the feeling I will be updating this to make it more useful.

My Dynamic QR Code Creator for vCards

Using ShortCodes in WordPress Text Widgets

Nov 24, 2011   //   by David   //   Blog, Coding  //  No Comments

Shortcodes can be incredibly useful in WordPress posts but have you ever tried to put them into a text widget? Not much luck there when all you get is the text showing the [shortcode] you entered.

Well, there is a quick and easy solution. Just add this to your functions.php file:

add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');

Source: using shortcodes everywhere

Simple. Now you’ll be able to use your cool shortcodes within text widgets.

iPhone, 1 Pixel Out Audio Player and HTML5 – The Prequel

Sep 14, 2011   //   by David   //   Blog, Coding  //  14 Comments

Lots of response to my original article about HTML5 and the 1 Pixel Out Audio Player. Unfortunately, most of it was because the original code and links died. I was able to get in touch with the author and he was kind enough to send all his files for me to repost and host here. Below is Ryan’s original article (with a couple minor edits requested):
Read more >>

Solution to WordPress “File param is missing” no CSS

Jun 14, 2011   //   by David   //   Coding  //  No Comments

If you’ve loaded up your WordPress site and found the CSS gone, you’re not alone.

Turns out there is a new bug in the W3 Total Cache plugin of WordPress where the minified CSS and JS files aren’t accessible. Your site will throw a 400 Bad Request error and if you try to access the referenced file directly you’ll get a “File param is missing” message.

The quick fix until it is addressed by the folks at W3 Total Cache is to disable the “Rewrite URL structure” option on the Minify tab in the W3 Total Cache options panel. Hopefully it’s just temporary and the next update will resolve the issue and you can turn the rewrite back on.

Loads.in Web Page Loading Time

May 26, 2011   //   by David   //   Blog, Coding  //  No Comments

Loads.in website for checking page load time

Test how fast your web page is loading by visiting Loads.in This can be a good first step in determining if your site is performing well. Of course, there are many other tools and techniques for determining when and where your slowdowns are occurring…or you can just give me a shout to have a look.

Pages:12»