Archive for the ‘developing’ Category

  • Cloudflare – My experience.

    Date: 2012.04.29 | Category: developing, development | Response: 0

    Cloudflare is a service that speeds up your website or blog loading speed times by handling your website DNS and acting as a CDN for your sites content. I tried it out on MySchoolHolidays.com

    CF = Cloudflare.

    Some things that rock:

    • CF sped my page loading up by minifying my JS/CSS etc and reducing the hops to the static content.  Also DNS lookups were marginally faster (<5%).
    • Some of the plugins available may be of use to others but weren’t for me and some of them even introduced JS bugs.
    • CF introduced me to some new techniques for doing stuff such as catching client side JS bugs.
    • CF would help me scale quick
    • CF protects against exploits and scrapers.
    • FREE and if you want pro you can pay a small amount.

    Some things that suck:

    • No round robin ergo no high availability for sites that use this which means greater downtime.
    • Poor customer support.
    • Horrible console and back end.
    • Bugs, lots of bugs.  Everywhere…
    • Paid option doesn’t really give you much in the way of improvements if anything.
    • CF “always online” feature doesn’t work.
    • No wildcard domains.

    Cloudflare have a great opportunity and a huge audience but they have some massive problems to deal with if they want to make it a worthwhile service for me to adopt across the board.

    Note: I’m too lazy to include stats.

    Summary: Use the free version, get used to using a CDN for offloading some page content.  Make sure you setup analytics before so you can review your page speed load times.   Amazon and Google have similar offerings that will probably have a higher QOS ergo provide a better ROI.

    Report This Post

  • Script to get an email when a new property in your area is registered on Gumtree

    Date: 2012.04.17 | Category: developer, developing | Response: 0

    This script will send you an email when a new property in your area comes up on twitter.. Replace shoreditch with the area you want and add in some email addresses. You will also want to modify the price.. at current it’s set to a minimum price of £150 per week.

    It was written to solve a problem where we would be out looking for flats/apartments and we needed to be one of the first people to respond. This script gave us the edge that meant we could secure a good property in the limited window of time we had.

    You need to be familiar with NodeJS to use this. Execute it as a cron job or however you want.. It will store results to a database called db.db

    The code was written by @pitapoison – He is an awesome developer, you should follow him. We literally made this over a cup of tea and a bowl of pasta, it took 15 minutes and saved many hours.

    I think it’s interesting to see the approach we used to solving a housing problem, something that affects everyone yet so few will take the time to create a piece of software that gives them the edge.

    var request = require("request");
    var parser = require("xml2json");
    var db = require("dirty")("db.db");
    var nodemailer = require("nodemailer");
    var transport = nodemailer.createTransport("Sendmail");
    
    db.on('load', function() {
      request('http://www.gumtree.com/rssfeed/single-room-flatshare/shoreditch', function (err, response, body) {
        if(err){
          throw err;
        }
    
        var json = JSON.parse(parser.toJson(body));
    
        var items = json.rss.channel.item;
    
        items.forEach(function(item){
          try {
            var title = item.title;
            var price = /([0-9]+)pw$/.exec(title)[1];
            var content = item["content:encoded"].replace(/\&\#[0-9]+;/g," ");
            var link = item.link;
    
            if(price < 150){
              return;
            }
    
            if(db.get(link) === true){
              return;
            }
    
            db.set(link, true);
    
            var emails = ["person1@example.com", "person2@example.com"];
    
            emails.forEach(function(email){
              var mailOptions = {
                  from: "gumtreebot@example.com",
                  to: email,
                  subject: "GUMTREE: " + title,
                  text: link + "\n\n\n" + content
              }
    
              transport.sendMail(mailOptions);
            });
    
          } catch(e){
            console.error(e.stack || e);
          }
        });
      });
    });
    

    Report This Post

  • When debugging IE stop it using cache

    Date: 2012.03.26 | Category: developer, developing, development | Response: 0

    I often have problems debugging Etherpad Lite in IE mostly due to IE having a hideous way of relentlessly holding onto files in cache.. well today I figured out to stop that problem and it’s super easy.. In Developer tools, Click Cache –> Always refresh from server

    Report This Post

  • Ajax CSV upload to a Table with jQuery and PHP

    Date: 2012.01.26 | Category: developer, developing, development, jquery, Php | Response: 0

    So I had to write a new user importer for School Email and I was looking for a simple plugin in solution but didn’t find one so here is a simple way of uploading a csv file that is uploaded to a file and rendered to a table..

    Projects used: CsvToTable & jQuery File Upload & Editable Grid *optional for live edits.

    Grab those two projects, grab the below files and put them in a /js folder then put the .js files into your head..

    Put the jQuery-File-Upload folder in your root, we will be uploading files to here.. You may want to add a layer of security in front of the upload function.

    <head>
    <script src="/js/csvToTable.js"></script>
    <script src="/js/jquery.iframe-transport.js"></script>
    <script src="/js/jquery.fileupload.js"></script>
    </head>
    

    At the bottom of your body add..

    <div id="csvToTable"></div>
    <div id="fileupload"></div>
    <script>
    var loggedIn = 1; // you will want to modify this if you require auth
    $(function () {
      if(loggedIn == "1"){
        $('#fileupload').fileupload({
          dataType: 'json',
          acceptFileTypes: '/(csv)$/i',
          url: '/jQuery-File-Upload/php/index.php',
          done: function (e, data, Users) {
            $.each(data.result, function(index, file){
              $('#csvToTable').html("");
              $('#csvToTable').CSVToTable(file.url).bind("loadComplete",function() {
                console.log("Loaded data into table");
                /*
    
                Call functions to manipulate data here
    
                */
              });;
            });
          }
        });
      }
    });
    </script>
    

    Want to make your table editor like the rest of the cool kids? Check out this jQuery plugin

    Report This Post

  • Is it possible to build Metro Desktop Tiles without Visual Studio?

    Date: 2011.11.14 | Category: developer, developing, development | Response: 3

    It pains me that I’m asking this but I have spent the last 3 hours using my favorite search engine looking for an answer to this question and I’m literally licking the pink knotted balloon of the internet right now so please hear me out..

    I hate developing on Microsoft platforms, it feels dirty. After watching the Windows 8 developer talks where they introduced Metro and had a bunch of students create their own tiles I figured how hard can it be?

    I’m not willing to use Visual Studio. Microsoft said Metro supports CSS/HTML/JS so I want to build my tile in notepad++. I don’t mind creating my own manifests, that’s fine, but I want to keep it open. I just don’t see a way to do this without installing an “app(has to be a binary)” and then binding that app to the desktop and hoping that Windows finds the manifest for the tile and implements it.

    Anyone had any luck? I’d love a little tutorial that just shows me how to get started.. Once I’m up and running I will be good to go!

    Thanks :)

    TLDR: I refuse to use Visual Studio so I want a way to create a desktop tile for Microsoft Windows Metro that doesn’t involve compiling anything.

    Report This Post

Chat with me

No sign in required