Skip to content

Instantly share code, notes, and snippets.

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to realize virtual resources User[nleonguid1551fl_adrianuid1800kwilczynskiuid1538cwatsonuid1563fl_russuid1806spikeuid1504abaranoskyuid1540fl_michaeluid1808lorenzouid1520fl_patuid1803jkelseyuid1515mseebachuid1522tomduid1530tomwuid1531mcialowiczuid1541mkouuid1566bfeldbaueruid1549fl_chrisuid1802fl_pauluid1804aparkeruid1506douglasuid1508jchanuid1513waseemtajuid1534szepedauid1547fl_andyuid1801fl_steveuid1807paweluid1523bhickeyuid1507fdilkeuid1509jmacleanuid1568fl_daviduid1809timleagueuid2018stalwaruid1528kamiluid1519jwozniakuid1544fl_peemuid1805], File[nleonguid1551fl_adrianuid1800kwilczynskiuid1538cwatsonuid1563fl_russuid1806spikeuid1504abaranoskyuid1540fl_michaeluid1808lorenzouid1520fl_patuid1803jkelseyuid1515mseebachuid1522tomduid1530tomwuid1531mcialowiczuid1541mkouuid1566bfeldbaueruid1549fl_chrisuid1802fl_pauluid1804aparkeruid1506douglasuid1508jchanuid1513waseemtajuid1534szepedauid1547fl_andyuid1801fl_steveuid1807paweluid1523bhicke

test tl;dr - Given heavy Javascript apps which people keep open for hours (or days) at a time, how do you deploy multiple times a day without screwing the user over or making the developer's life really hard? Discuss!

Reliable continuous deployment for stateless web applications can be done reasonably easily. For example:

  • Have 2 instances (A and B) of your application on each server
  • With A instances in the load balancer, upgrade green instances
  • Add B instances to the load balancer
  • Remove A instances from the load balancer
<?php
session_start();
$m = mysql_connect();
mysql_select_db("test", $m);
if (isset($_POST['logout'])) {
unset($_SESSION['user_id']);
unset($_SESSION['fullname']);
}
@bobtfish
bobtfish / example
Created June 16, 2012 15:48
Message-Passing examples
#!/bin/sh
message-pass \
--input STDIN \
--output STDOUT
@bobtfish
bobtfish / FixFCGIPath.pm
Created April 20, 2012 15:08
Fix Plack::Handler::FCGI issues with nginx PATH_INFO
package Plack::Middleware::FixFCGIPath;
use strict;
use warnings;
use base qw/ Plack::Middleware /;
sub call {
my ($self, $env) = @_;
if (length($env->{PATH_INFO})) {
$env->{PATH_INFO} = '/' . $env->{PATH_INFO}
@bobtfish
bobtfish / code.js
Created April 19, 2012 14:31
BSON packing javascript
function compress_simple(s) {
var i=0, l, out='';
if (s.length % 2 !== 0) s += ' ';
for (l = s.length; i < l; i+=2) {
out += String.fromCharCode((s.charCodeAt(i)*256) + s.charCodeAt(i+1));
}
return out;
}
function uncompress_simple(s) {
This file documents the revision history for Perl extension TestFlood.
0.01 2012-04-13 08:45:03
- initial revision, generated by Catalyst
package Shutterstock::Example::Nonblock;
use Web::Simple;
use Plack::App::File;
use File::ShareDir::ProjectDistDir;
use File::Spec::Functions;
use Imager::Simple;
sub share { our $share ||= dist_dir 'Shutterstock-Example-Nonblock' }
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
my $foo = chr(0xff);
is(length($foo), 1, "character length of string is 1");
ok(!utf8::is_utf8($foo), "string not utf-8 upgraded");
- Test 1 or 2 more apps
- write tests for getting default_model / default_view from config?
- move block from sub controller to Catalyst::Utils
- kill components class data
- kill initialization in sub setup
- kill duplication: http://paste.scsys.co.uk/123648
- create a sub components that returns all components
- merge with around components => sub {}
- locked hash (Hash::Util)
- block inside sub setup: