Updating a SPA automatically without browser refresh

Updating a SPA automatically without browser refresh

I was asked a very interesting interview question today.

Lets assume you have a single page application running on n users computers as a dashboard and you updated the application, how does all of the clients receive and manage the updated assets without incurring a browser refresh.

The first problem to figure out is how do I know the application was updated?

  1. Polling the entry bundle asset
  2. Polling the Index.html and comparing hashes/versions
  3. Polling some custom tiny server text doc
  4. Dashboard websocket contains the version
  5. On acquisition of new data it contains version
  6. We don't update until a

Read More

Zsh Theme For Pragmata Pro

Zsh Theme For Pragmata Pro

#!/usr/bin/env zsh

local LAMBDA="%(?,%{$fg_bold[green]%}λ,%{$fg_bold[red]%}λ)"  
if [[ "$USER" == "root" ]]; then USERCOLOR="red"; else USERCOLOR="yellow"; fi

# Git sometimes goes into a detached head state. git_prompt_info doesn't
# return anything in this case. So wrap it in another function and check
# for an empty string.
function check_git_prompt_info() {  
  if git rev-parse --git-dir > /dev/null 2>&1; then
    if [[ -z $(git_prompt_info) ]]; then
      echo "%{$fg[blue]%}detached-head%{$reset_color%}) $(git_prompt_status)
%{$fg[yellow]%}→ "
    else
      echo "$(git_prompt_info) $(git_prompt_status)
%{$fg_bold[cyan]%}→ "
    fi
  else

Read More

Responsive Game Interfaces

Responsive Game Interfaces

It's abundantly clear that making interfaces for portals, single page applications, analytics or CRUD apps is so much easier than creating applications for games. UX within games is much more complicated. Now add upon that complication a responsive design.

It took the better part of 8 hours to get a design mock-up that worked on the smallest iphone device (man they're tiny!) and that scales up to the largest phablet. I still need to work on detaching the pane and having a more diablo-esque two-pane character panel / inventory approach for desktop users.

The largest surprise in this day endeavor was

Read More

Textures make a difference

Textures make a difference

I've been playing around with textures in exploring the bleak to see how much of a difference it would make. Essentially I'm torn between two ideas:

  1. Make the floors all a plain color and glow them based on the environment color so as not to be too realistic and keep a more roguelike feel.
  2. Struggle with having textures that blend together between sectors so it has a more natural feel albeit simple in perspective to traditional 3d games.

At the moment I'm leaning towards number two, but I haven't been able to reproduce a reliable glow postprocessing effect that I

Read More

No FPS is a Roguelike

No FPS is a Roguelike

I've struggled with the concept of merging the roguelike turn-based system with a FPS. Having a turn based on when you fully leave a cell makes the monsters seem jumpy which doesn't make for very nice gameplay. Because I believe turn-based systems are core to roguelikes and first person shooters can't be turned based in a cohesive way, I've dropped the FPS perspective altogether and pulled the camera above the player.

7DRL Day 2

  • Dropped the morphed terrain map for a scene that grows collections of boxes and planes as the map is discovered. Maps can now be infinitely grown

Read More