intertwingly

It’s just data

pegurl.js

pegurl.js is the result of two days worth of work.  While it is undoubtedly buggy and incomplete, it does pass 255 out of 256 tests and that last test is wrong.  For comparison: results from other user agents.

Current work products:

Future work:


WHATWG URL vs IETF URI

I’ve been looking into differences between the WHATWG URL Living Standard and the combination of RFC 3986 and RFC 3987.  I’ve come up with an indirect but effective way to identify the differences using urltestdata.txt and addressable.

...


Dreamhost upgrade

Dreamhost upgraded my server to Ubuntu 12.04.  I noticed things breaking in preparation for the move, and things that broke after the move.  If you see something not working correctly, please let me know.


The URL Mess

tl;dr: shipping is a feature; getting the URL feature well-defined should not block HTML5 given the nature of the HTML5 reference to the URL spec.

This is a subject desperately in need of an elevator pitch.  From my  perspective, here are the three top things that need to be understood.

...


New Toy

New laptop for work: MBP 15.4/2.6/16GB/1TBFlash.  First time I ever went the Apple route.  I did so as I figured with those specs, I could run multiple operating systems simultaneously.  So far, so good.  I’m using VirtualBox to do so.

Notes for Mac OS X 10.9, Ubuntu 14.04, Windows 8.1, and Red Hat Enterprise Linux 6.5.

...


Travisizing My Projects.

Today, I got a pull request from Ryan Grove to make nokogumbo work on Ruby 2.1 and add Travis support.  Very cool.  I was surprised how easy it was to set up.

A few hours later I got ruby2js to work on Ruby 2.0 and 2.1 and added Travis supportWunderbar worked right out of the box.


Frameworks as Stepping Stones

Joe Gregorio: But something else has happened over the past ten years; browsers got better. Their support for standards improved, and now there are evergreen browsers: automatically updating browsers, each version more capable and standards compliant than the last. With newer standards like HTML Imports, Object.observe, Promises, and HTML Templates I think it’s time to rethink the model of JS frameworks. There’s no need to invent yet another way to do something, just use HTML+CSS+JS.

I’m curious as to where Joe believes that these features came from.

...


Technology behind Whimsy.apache.org

W

Slides for my ApacheCon talk.  Right/left goes to the next/previous section, up/down for navigating with a section.

The demo is unfortunately only available to ASF committers (for privacy reasons, as it exposes email addresses).


Angular.rb example

Tim Bray: If hating this is wrong, I don’t want to be right.

Perhaps you would like this better?  :-)

...


Time Warner Rate Hike

Backdrop:

With that context, today I got in the mail notification that my rates are set to go up by 60% as my “Promotional” rates (Seriously?  A twenty two year long promotion?) will be expiring.  After spoofing my User Agent as the chat function doesn’t recognize my browser/operating system combination, I verified this is indeed the plan with “Veronica”.  I was then provided a transcript and directed to an online survey when promptly logged me off without submitting my feedback once I had completed it.

I plan to follow up with @TWC_Help.


Wunderbar JQuery filter

W

I got a suggestion to look into React.js, a JavaScript library which is focused on the problemspace that Angular.js’s directive addresses.

One of the ways React.js facilitates the creation of web components is via JSX which mixes “XML” with JavaScript.  The “XML” is “desugared” into React.DOM calls.

Based on this idea, I created a Wunderbar jquery filter to “desugar” Wunderbar calls into JQuery calls.  The tests show some of the conversions.  I also updated my Bootstrap modal dialog directive to make use of this: before => after.


Ruby2js += underscore.js

When compared to Ruby, JavaScript doesn’t have as much functional support built in.  Underscore.js fills that gap for many.  Underscore.js, in turn, was inspired by Ruby’s Enumerable module.  A underscore filter (tests) completes the mapping.

In many cases, the resulting JavaScript is formed by applying a number of filter rules.

...


Ruby2JS Attribute=>Property support

Ruby2JS now maps Ruby attributes to JavaScript properties.

...


HTML5 Mode Links

Based on a suggestion by Tim Bray, I converted my board agenda Angular.js application to use html5 mode.  The process was straightforward:

1) add the following to your application configuration:

$locationProvider.html5Mode(true).hashPrefix('!')

2) Add a <base> element to my generated HTML, indicating which part of my path was “owned” by the server.

3) Convert my relative links.  Based on how my application was structured:

I’ve not yet tested it with Internet Explorer <= 9, but the Angular.js docs indicate that it should work there too.


Software in 2014

Tim Bray: We’re at an inflection point in the practice of constructing software. Our tools are good, our server developers are happy, but when it comes to building client-side software, we really don’t know where we’re going or how to get there.

While I agree with much of this post, I really don’t think the conclusion is as bad as Tim portrays things. I agree that there are good server side frameworks, and doing things like MVC is the way to go.

I just happen to believe that this is true on the client too – including MVC. Not perfect, perhaps, but more than workable. And full disclosure, I’m firmly on the HTML5-rocks side of the fence.

...


Wunderbar Tutorial

W

I’ve begun work on a Wunderbar tutorial.

Feedback welcome.


Angular.rb update

It does indeed turn out that language macros can reduce the amount of Angular.js boilerplate configuration to a minimum.  In the process I’ve spun off ruby2js is a standalone supporting library.


Angular.rb

I’m looking into what it would take to make it easier to produce Angular.JS client applications using a server coded in Ruby.  The approach I’m taking is to convert idiomatic Ruby into idiomatic AngularJS JavaScript.

Demo.  Corresponds roughly to tutorial step 4Example outputSpecs.


Mavericks

Did a clean install of Mavericks on my test mac-mini.  Things to be aware of for next time:

xcode-select --install

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain

sudo mkdir -p /usr/local/lib; sudo ln -s /usr/local/mysql/lib/libmysql* /usr/local/lib

The Pile of Poo Test™

Mathias Bynens: Whenever you’re working on a piece of JavaScript code that deals with strings or regular expressions in some way, just add a unit test that contains a pile of poo (💩) in a string, and see if anything breaks. It’s a quick, fun, and easy way to see if your code supports astral symbols. Once you’ve found a Unicode-related bug in your code, all you need to do is apply the techniques discussed in this post to fix it.