A few of my thoughts on a few web-related issues. Feel free to contact me at michal@charemza.name or post a comment.

Blue-Green Deployment of Static Site on S3

API Gateway in a blue-green deployment strategy

This post contains the high level steps for the site architecture and deployment strategy for blue-green deployment for a static site hosted on S3. There are a few things that are required for a reasonable blue-green strategy. No downtime…

Defer node stream processing

Delay chain of piped streams until a promise is resolved

There might be times when you have a chain of piped streams where you want to delay a part of the chain until a promise is resolved. You can do this with a function that returns a simple Transform stream. function waitFor(promise) { return…

Animating elements moving between lists

Anchored CSS transitions to move elements between ng-repeat lists

Animating elements between parts of an application can be tricky. The beauty of ng-repeat means we can declare that a list, such as a ul, should represent a data model, such as an Array of data, and the list keeps up to date with whatever changes we…

Throttled variable changes

Delay variable changes in AngularJS templates using shadowing

Usually shadowing introduced by prototypical inheritance of $scope is something to be avoided, often the source of bugs cause by not having a dot in models. However, there is a way it can be used to throttle variable changes in templates. Thottling…

Same-domain iframe communication

AngularJS scope events for same-domain bi-directional iframe communication

It's possible for Angular apps to communicate, where one is running in an iframe of a parent, using standard scope events. This means you can treat an iframe much like a custom directive, responding to $broadcast-ed events, or $emit-ting its…

AngularJS Transclude

Break free from the DOM: move compiled elements to arbitrary locations

Transclusion allows a directive to move clone(s) of the contents of a directive to an arbitrary place in the DOM. Usually this is at the original location of the directive, wrapped in some extra elements, but it doesn't have to be. So why move the…

AngularJS Promises

Chaining, failures, notifications

AngularJS promises are an extremely powerful tool. They allow you to make a multi-layered and complex system based on asynchronous functions, with error and in-progress notification handling, all without getting into callback hell. This post…

ECONNRESET Errors in node.js

Socket.io and Express on the same port

The Problem Running a basic node.js + express + socket.io setup, I would occasionally get ECONNRESET errors. After a bit of trial and error, I found that this seems to have been caused by running socket.io and express on the same port, port…

Dependency-Based Cache Invalidation

Russian doll dependency-based cache invalidation system for PHP and Memcached. Part 1: Design.

The problem With an ever-increased user and code-base, with ever increasing amounts of data, we are approaching limits of what any single relational database can handle over at intelligentgolf. Caching output of database queries and/or generated…

About This Site

Jekyll, S3 and Cloudfront

A few technical details about this site. Front End A couple of fonts are included from Typekit. and a few Fontawesome icons are used as well. Disqus for comments, as below. Repsonsive by way of a single @media query to change the position of…

JQuery UI Datepicker Incorrect Century

On certain yearRange options

This is a known bug bugs.jqueryui.com/ticket/8873, but I couldn't find it on a search, so it might be helpful to post here. I was creating a datepicker for a date of birth field, with no default value, and with a yearRange of "c-100:c-1". However,…

Thinking Fast and Slow

A few thoughts / review

Thinking Fast and Slow is a pop psychology book, but one that leans on the academic side, detailing psychological experiments and applications of their consequences. Its main theme is how the assumptions of traditional Behavioural Economics, the…

AWS Load Balancer

Beware long POSTS: they duplicate

A word of warning to those who use AWS Elastic Load Balancing. The default configuration is that any request that hasn't had any data sent from the web server for 60 records, results in the balancer resending the request. The reason for this,…