Modulus-based index for cycling array values

Ah! I forgot about using modulus operator as array index for cycling through array values! Thanks for the reminder, Angular docs (One Time Binding example).

Note the relevant bit:

$scope.name = names[counter % names.length];

Normally I think I’d do something dumb like:

  var counter = 0;
  var names = ['Igor', 'Misko', 'Chirayu', 'Lucas'];

  $scope.clickMe = function(clickEvent) {
    $scope.name = names[counter];
    if (++counter >= names.length ) {counter = 0;}
  };

Which maybe I guess isn’t super dumb, but I like the elegance of the Angular example, as it does away with the minor-but-present cognitive overhead of “do I greater-than/equal this, or just greater than, or pre-increment, post-increment, subtract one from the array length?” mess.

Also, in my version, you lose the counter’s true value, as it becomes more of a cycle counter.

Keith Haring Interview

How did Burroughs influence you?

Burroughs’s work with Brion Gysin with the cutup method became the basis for the whole way that I approached making art then. The idea of their book, The Third Mind, is that when two separate things are cut up and fused together, completely randomly, the thing that is born of that combination is this completely separate thing, a third mind with its own life. Sometimes the result was not that interesting, but sometimes it was prophetic. The main point was that by relying on so-called chance, they would uncover the essence of things, things below the surface that were more significant than what was visible.

As a fan of Burroughs, both his work and the stories about him and his approach to writing, this answer was a highlight of the excellent Rolling Stone interview with Keith Haring.

[Usual disclaimer that these photos do not do justice to seeing the works in person. One of my favorite aspects of attending the exhibit was getting transfixed in all the little paint drips and splatters that were present in many of the large vinyl/tarp pieces.]

Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young
Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young

Keith Haring "The Political Line" exhibit at de Young

ColourLovers API mini-project

colors.telecommutetojuryduty.com

Built using Angular, Bootstrap, and open access to the ColourLovers.com api, check it out! It’s a simple way to view the most popular patterns, palettes, and individual colors from ColourLovers.com.

This was a super old site I built long, long ago, with some pretty scrappy jQuery and gross jQuery markup templates, but it felt like a good thing to upgrade now that I’m learning Angular. Plenty of features I’d like to add, but for now, it’s mostly just a quick n’ easy way to browse some nice tones.

Source code is available to peruse here.

This URL is Haunted

Well… not this one. This one.

This is a bit of a Frankenstein’s monster I culled together from old projects.

Current bits: Node.js, Grunt, Bower, jQuery, Handlebars, Sass, Compass, and Instagram’s API. Code is open source on Github here.

Hoping to port it, cleanly, either to Angular or React soon. (Though it’s fairly simple so there won’t be much flexing of either framework, rather, it’d just be more practice for me than anything.)