Articles

Page 4



  • Start using Git

    ๐Ÿ•‘8 minute read
    February 9, 2016

    Turning any project in to a Version controlled project is really simple and should be one of the first steps in any project workflow. By the time you realise that you need a version controlled file, itโ€™s usually too late โ€“ whether you have accidentally overwritten a days worth of work on a file, or you deleted the wrong thing. Since itโ€™s so easy to setup, thereโ€™s really no excuse not to. There are a few best practices and tips as well as a few gotchas to note along the way but donโ€™t worry, Iโ€™ll be pointing ...


  • CSS best practices

    ๐Ÿ•‘5 minute read
    December 16, 2015

    There are a few ways of writing css. For consistency, we will adopt only one naming convention. This is lowercase and hyphen separated. It is the most readable and fits well with other CSS methodologies that are covered below.

    Yes

     .hyphen-separated {...} 

    No

     .camelCase {...} .underscore_separated {...} .alllowercase {...} .ALLUPPERCASE {...} 

    Specificity

    Keep your selectors short and with as low a specificity as possible. A maximum of three classes in your selectors is recommended. Why? Two reasons:

    • Selectors...

  • WordPress localhost redirects to live site

    ๐Ÿ•‘1 minute read
    May 2, 2015

    When you are developing on WordPress sites it's always quicker to work on a local machine/development server. It's essential to work from the same data as the live site so you can work effectively as possible so taking a copy of the live database and installing it locally is the best and quickest option... but there is one potential pitfall.

    Because WordPress store site settings in the database it means that all the site addresses that were on the live site are now on your development site, meaning every action...


  • Swift timer

    ๐Ÿ•‘1 minute read
    March 8, 2015

    This is a simple timer, using Swift.

    var theTimer = NSTimer() //function to start the timer (if needs be)  func startTimer() { //start the timer with a 5 second delay  self.theTimer = NSTimer.scheduledTimerWithTimeInterval(5, target: self, selector: Selector("timerIsDone"), userInfo: nil, repeats: false) } func stopTimer() { //start the timer with a 5 second delay  self.theTimer.invalidate() } //The function called when the timer is done  func timerIsDone() { println("Do something") stopTimer() } //start the...

  • The joy of calc()

    ๐Ÿ•‘2 minute read
    November 3, 2013

    calc() is a modern css function that allows you to do basic maths in a css file. You can use it to make semi fluid layouts with great ease. This means that you can have layouts with 1 fixed width column (or more) and the rest fluid. It doesn't just stop at columns, but that is the easiest and quickest example to discuss.

    The setup of calc is very simple. If we take a 2 column layout as an example, the side column always has 200px of width, the main will take up the rest, so 100% less 200px!

    /* Fixed columns...

  • Creating a chrome extension - an update

    ๐Ÿ•‘2 minute read
    June 7, 2013

    Since I wrote my last post on creating a Chrome extension , there have been a few changes to how the extensions are built - mainly that the manifest version has changed to version 2. The original post is still fine, but there are a few tweaks needed. This post is mean mainly as an update to the original, so rather than rehash the old content too much I will skim over the basics quickly.

    • Create a folder for your plugin - name it after your extension so you can find it later!
    • In a text editor create 4 documents...

  • Arabic web fonts

    ๐Ÿ•‘2 minute read
    November 16, 2012

    I've been looking for a good solution for Arabic web fonts for while now and have been hitting my head against the wall with the lack of options available to me or the cost of buying a font and hosting it myself.

    Just as I was contemplating making my own arabic font (no easy feat) it would seam that some of web services are beginning to add some decent options. Since I use Typekit I would prefer this to be the service with the Arabic fonts, but at the time of writing this isn't the case. This currently means...


  • Changing the version of SASS in LiveReload

    ๐Ÿ•‘2 minute read
    July 9, 2012

    LiveReload is great a great tool for any web developer. One of the most useful of it's features is the ability to compile SASS on save. Unfortunately the version of SASS that is included in LiveReload isn't the latest one and it just so happened that was the version I needed (3.2 alpha). Long story short, I updated the version of SASS that LiveReload uses on my machine. I'm not sure if it will break anything but backup your LiveReload App just in case. If you ever update LiveReload you will need to redo the...


  • A Responsive Image jQuery Plugin

    ๐Ÿ•‘2 minute read
    May 15, 2012

    There are a whole variety of ways that responsive images can be accomplished, but as of yet there is no perfect way of doing it without using a combination of .htaccess, javascript and css. My solution is no different and uses JavaScript (in the form of jQuery) as the coordinator of the images.

    responsiveBreakpointJQ works by specifying the images that will show if the screen of the device is big enough. The data-XXX values are how the appropriate image is specified. If a screen is wider than the XXX value ...


  • Creating a chrome extension that uses jQuery to manipulate the DOM of a page

    ๐Ÿ•‘4 minute read
    December 8, 2011

    There are plenty of tutorials and guides on how to make a chome extension and there are hundeds for jQuery manipulation of the DOM. There are also a few about using jQuery in a chome extension, but only for the popup window. There seems to be a lack of using jQuery to actually do something on a page. This is something that too me a while to get my head around and a bit of googling to figure out, so now it's time to share.

    Create a folder for the extension files. It's probably best to name it after your extension...