This is a summary of the system setup used for the demonstration on 2016-07-18.
This was put together with the following intent:
- It must build upon an unmodified CoreOS user space image.
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain). | |
* Copyright 2015 Google Inc. | |
* | |
* Use of this source code is governed by a BSD-style license that can be | |
* found in the LICENSE file. | |
*/ | |
/* | |
The official instructions don't work well. These alternative instructions are intended to be the shortest path to get a minimal setup running. |
// Comcast Cable Communications, LLC Proprietary. Copyright 2014. | |
// Intended use is to display browser notifications for critical and time sensitive events. | |
var _ComcastAlert = (function(){ | |
return { | |
SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do' | |
, dragObj: {zIndex: 999999} | |
, browser: null | |
, comcastCheck: 1 | |
, comcastTimer: null | |
, xmlhttp: null |
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
(A book that I might eventually write!)
Gary Bernhardt
I imagine each of these chapters being about 2,000 words, making the whole book about the size of a small novel. For comparison, articles in large papers like the New York Times average about 1,200 words. Each topic gets whatever level of detail I can fit into that space. For simple topics, that's a lot of space: I can probably walk through a very basic, but working, implementation of the IP protocol.
""" | |
This is an example of how to use Hypothesis to test a classic combinatorial | |
optimisation problem without having a reference implementation to compare | |
against. | |
The problem we're going to look at is the knapsack packing problem: Given a | |
set of objects with value and weight, how can maximize the total value while | |
keeping the total weight under a certain amount. | |
You can solve this exactly as an integer linear programming without too much |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'gems' | |
require 'json' | |
class Package < Struct.new(:name, :language, :version, :hash, :source, :homepage, :depends) | |
end | |
class Dependencies < Struct.new(:hostmake, :make, :runtime) |
See https://github.com/romainl/vim-rnb for an up-to-date version.
--- | |
- hosts: all | |
vars: | |
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx' | |
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx' | |
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com | |
ubuntu_common_deploy_user_name: deploy | |
ubuntu_common_deploy_public_keys: | |
- ~/.ssh/id_rsa.pub |
# Get the shortest match (least distance between start and end index) for all | |
# the query characters in the given text. | |
# | |
# Returns an array in format [firstIndex, matchLength, [matchIndexes]] | |
shortestMatch = (text, queryChars) -> | |
starts = allIndexesOf(text, queryChars[0]) | |
return if starts.length is 0 | |
return [starts[0], 1, []] if queryChars.length is 1 |