Skip to content

Instantly share code, notes, and snippets.

@bradgignac
bradgignac / memcache.md
Last active August 29, 2015 13:57
Memcached

Deployment

  1. Memcached Per Node, Non-Clustered
    Pilot is only aware of the memcached instance running on localhost. Caching happens per-node, so the percentage of cache hits is the lowest of all deployment strategies. Per-node deployments (IMO) are largely an artifact of dedicated servers that had extra RAM that was being wasted, i.e. a 4GB workload running on an 8GB server.

  2. Memcached Per Node, Clustered
    Pilot is aware of each memcached instance running on each web server. The memcached client uses a hashing algorithm to decide which keys are stored on which memcached server instance. The failure scenario for this strategy is interesting. When a web node goes down, you see performance degradation on the other web server because of increased load (2/3 nodes available) and a drop in cache hits. See the note below about consistent hashing.

  3. Dedicated Cluster
    Pilot is aware of each memcached instance running in a dedicated cluster. The biggest advantage is that web node failu

@bradgignac
bradgignac / grid-example.js
Last active January 3, 2016 14:49
Knockout Grid
collection = servo.collection(); // or simply ko.observableArray()
viewModel = ck.grid.observable(collection);
grid = ck.grid(viewModel, {
'foo': ck.grid.column('link', { sort: true }), // Sortable link column.
'bar': ck.grid.column('text', { sort: false }), // Non-sortable text column.
'someComputedColumn': ck.grid.column('text', { sort: function () {...} }) // Sortable text column with custom sort function.
});
@bradgignac
bradgignac / boolean.js
Last active December 29, 2015 09:09
Servo Boolean Observable
goog.provide('servo.boolean');
goog.require('servo.observable');
servo.boolean = function (value, options) {
return servo.observable(value, function (value) {
return typeof value === 'boolean';
}, options);
};
@bradgignac
bradgignac / canon-shim.css
Created November 18, 2013 18:14
Canon Shim
.rs-body {
position: absolute;
top: 30px;
bottom: 65px;
left: 0;
right: 0;
}
.rs-body > .rs-container,
.rs-body > .rs-container > .rs-main,
@bradgignac
bradgignac / generated-code.html
Last active December 28, 2015 06:19
Polymer Example
<div class="rs-detail-section">
<div class="rs-detail-section-header">
<div class="rs-detail-section-title">{{title}}</div>
<div class="rs-detail-section-summary">{{summary}}</div>
<div class="rs-detail-section-toggle"></div>
</div>
<div class="rs-detail-section-body">
<!-- This is all user-provided code that will appear in the section body. -->
<div class="rs-btn-group">
<button class="rs-btn rs-btn-primary">Add Widget</button>
@bradgignac
bradgignac / create-server.rb
Created September 23, 2013 18:53
Testing Server Creation
it 'can create server' do
# Login
visit 'https://ui.preprod.rackspace.com'
fill_in 'Username', 'this is my username'
fill_in 'Password', 'this is my password'
# Go to server create page
click_link 'Servers'
click_link 'Create Server'

Why Here? Why Now?—About Rackspace Hosting

Rackspace Hosting is the service leader in cloud computing and the founder of OpenStack, the leading open source cloud platform. We deliver enterprise-level managed hosting, cloud hosting and e-mail hosting services to businesses of all types and sizes around the world. We serve over 190,000 customers from data centers around the world, and that number continues to grow. Rackspace integrates the industry's best technologies and practices for each customer's specific needs, delivering it as a service via the company's commitment to Fanatical Support®.

For the over 5,000 current Rackers, however, we are much more than a hosting company. Rackspace offers a vibrant company culture filled with compelling work, a supportive team environment and a lot of fun. We are as Fanatical® about serving our clients and one another as we are about building the future of technology.

We compete in the same space as Amazon, Microsoft and Google because the work that Rackers do

@bradgignac
bradgignac / server_list.js
Created September 4, 2013 21:02
Knockout List View
ck.servers.list.View.prototype.createTemplate = function () {
return ck.template.servers.listView({...});
};
ck.servers.list.View.prototype.createViewModel = function () {
var servers, entities;
servers = this.getDependency(ck.data.servers.Servers);
checks = this.getDependency(ck.data.monitoring.Checks);
@bradgignac
bradgignac / router.js
Created August 9, 2013 21:52
Ember Email Client Routes
App.EmailClient.Router.map(function () {
this.resource('mailboxes', '/', function () {
this.resource('messages', '/:mailbox_id', function () {
this.resource('message', '/:message_id');
});
});
});
@bradgignac
bradgignac / building-marconi-browser.md
Last active December 19, 2015 17:29
Building Marconi Browser

Hey Team,

Here's a collection of thoughts I put together on building a SPA with Ember.js.

Why Ember.js

I looked at many frameworks when choosing what one to use with Marconi Browser. Based on my experience on Reach, Backbone (and Spine) were out due to their lack of support for two-way view binding. Knockout was out because it's a partial solution - it only provides a binding solution. There's a handful of others (Knockback, Batman, CanJS), but they seem to have lost momentum over the last year or two. In my eyes, the two big modern webapp frameworks are Ember.js and AngularJS. Here's why I went with Ember:

  • One
  • Two