• Goodbye RequireJS, Hello Browserify

    I no longer believe that Browserify is the way to go for JS modules, I was just entranced by it at first. I've put my bets on ES6 module syntax with a transpiler such as Babel or Traceur, combined with SystemJS

    For a long time now, I’ve been relying on RequireJS for JavaScript dependency and module management and we have it incorporated into our front-end JavaScript workflow at work as well. There are a few things that have always bothered me about it:

    1. Third party libraries, if not properly set up to use AMD, are a pain to include and use. Sure there are shims in RequireJS, but I’ve always found the system flaky and hard to understand.

    2. Though not always an issue, we’ve found that sometimes modules simply do not load in the correct order, and it is difficult to diagnose the issue or to force them to load in the required order.

    3. Dependency management amongst third party modules is often a nightmare, as the location of the modules that the third party libraries require are often not in the same location as where you want them.

    4. The require and define syntax can sometimes be laborious, e.g. for libraries that do not need a variable in the function () {} call.

    5. I’ve found that require modules are hard to concatenate in the correct order into one file, as well as uglifying at the same time.

    These things have had me waiting for a new module system to come along and finally it’s time to say goodbye RequireJS, hello Browserify.

    read more...

  • What makes a bad software developer?

    I came across this question on Quora a while ago (see What are the characteristics of a bad software engineer?, and while the answer with the most upvotes is quote comprehensive, it made me think about the question a bit myself.

    I would say the biggest indicator of a bad software developer is someone who is unwilling to learn and unwilling to improve themselves, which manifests itself in a lot of different ways. The first of these that springs to mind is Quality.

    read more...

  • Sensible .NET REST APIs with AttributeRouting.NET

    AttributeRouting.net no longer exists, and it is thankfully no longer needed because the .NET Web API is now 1000x better.

    I have a lot of problems with the default .NET Web API that Microsoft pushes for people to use. You can only easily have two GETs, and one PUT, POST and DELETE route per controller. There is no easy way to create more complicated nested routes, i.e. GET /v1/person/:id/contact/:id, or routes that deviate from the norm. The routing syntax (not just specific for the Web API but other .NET services too) is horrible and unwieldy, and all routes must be defined in a separate file. Route constraints, precedence and validation are also tricky.

    All of this may turn you off of writing an API in .NET, but there is an easy solution to all of these problems in the form of AttributeRouting.NET. This NuGet package allows you to define routes directly on controller methods, with out of the box support for route constraints, prefixes, precedence etc. It is compatible with the Web API and also .NET MVC.

    read more...

  • Run shell commands from Ruby

    Just a quick tip, you can run shell commands from Ruby using the following syntax:

    %x(git log)
    # or
    system('git log')
    

  • DocuSign Connect XML Schema

    For those of you that have developed for the DocuSign E-Signature platform, you’ll have probably used their DocuSign Connect service to listen for document and recipient events so you don’t have to long-poll their servers, which they strongly discourage. The example XML in their Connect documentation frustratingly does not have all of the possible values and fields that could come through with each request.

    I decided to investigate this and came upon this StackOverflow Q&A that had a handy answer, which linked to the complete DocuSign Connect XML Schema as an XSD. You can find the XSD below:

    DocuSign Connect XML Schema (XSD)

  • Print GitHub Markdown Bookmarklet

    There is no guarantee this works anymore, GitHub have probably changed their CSS classes etc. by now.

    I was looking for a way to print GitHub markdown documents without all of the GitHub navigation, UI and other extraneous information showing up on the page. Mainly because I like GitHub’s clean markdown styles, and it’s very useful to be able to print documentation for certain projects.

    All you need to do is add the following bookmarklet to your browser:

    javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd=="loaded"%7C%7Cd=="complete"))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.3.2",function($,L)%7B$('%23header, .pagehead, .breadcrumb, .commit, .meta, %23footer, %23footer-push, .wiki-actions, %23last-edit, .actions, .header, .file-navigation, .sunken-menu-contents, .site-footer').remove(); $('%23files, .file').css(%7B"background":"none", "border":"none"%7D); $('link').removeAttr('media');%7D);
    

    Here is a demonstration of what it does with the intridea/grape repo’s README.md file (before and after):

    github print before github print before

  • Could not successfully convert UCS-2 string to UTF-8

    I have no idea how to actually get and install the FreeTDS drivers, I think they may have already been installed on the AWS Instance AMI we were using at the time.

    We were performing a massive data migration at work from MSSQL to MySQL using the Migration Wizard in MySQL Workbench. When performing the step that copied the data from one server to the other, we got the following error for some nvarchar columns:

    Could not successfully convert UCS-2 string to UTF-8

    Or alternatively, we also got Error during charset conversion of wstring: No error. This infuriating error took us an hour and a half to diagnose and work around. I finally stumbled upon this link to a bug on the MySQL bugs website relating to MySQL Workbench http://bugs.mysql.com/bug.php?id=69629.

    The problem, it turns out, lays with Microsoft’s ODBC Drivers:

    This bug is triggered due to improper UCS-2 strings being generated by Microsoft’s ODBC drivers.

    And the solution is to select the FreeTDS ODBC Drivers in the first step of the migration wizard of MySQL Workbench. The migration then works perfectly with no further encoding complaints. I hope this helps someone else out with this frustrating problem!

    FreeTDS

  • The SMS That Started It All

    Today I want to show you the SMS that started it all and began my career as a software developer.

    the sms

    One day in October 2010 my manager and I sat down to discuss a database solution for our company. We had unsuccessfully tried to use another company’s solution for our business needs but found them lacking, and we were already running an Access database for some of our data. At this time I had no experience with databases whatsoever, not even the basics such as tables, columns and primary keys. Jacob wanted to gauge my interest in learning about databasing and Visual Basic so we could develop our own solution. Needless to say I was very keen.

    read more...

  • Failed to build gem native extension on OSX Mavericks

    This article is likely no longer relevent, follow the instructions at your own risk!

    When installing certain gems on Max OSX Mavericks you may run into some issues where either the gem install or bundle install command throws the error “Failed to build gem native extension”, usually in extconf.rb. This has happened specifically to me with the json and mysql2 gems. Some gems may work exactly as expected.

    The reason for this odd behaviour is because in the latest release of XCode 5.1, Apple are treating any unknown command line options as errors.

    read more...

  • Another Year, Another Redesign

    I've redesigned again since this article, though you may find some of the links helpful.

    We are in the future of 2014 and since it’s been about a year since I’ve changed this blog’s design, I thought time would be ripe to do it again! It’s taken me quite while longer than I would have like this time, but I have a good excuse for that in the form of the birth of my first son!

    read more...

7 // 11

 

 

Want to read regular updates? Subscribe via RSS!