The intent is to define terse, standards-supported names for AWS regions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Launch a Pod ab-using a hostPath mount to land on a Kubernetes node cluster as root | |
# without requiring `privileged: true`, in particular can abuse `DenyExecOnPrivileged` | |
# admission controller. | |
# Pod command in turn runs a privileged container using node's /var/run/docker.sock. | |
# | |
# Tweaked for PKS nodes, which run their docker stuff from different | |
# /var/vcap/... paths | |
node=${1} | |
case "${node}" in |
When scheduling actions to be carried out at a specific time there are a wealth of options. Each option suitable for a very different use case. The aim of this description is to present a use case with requirements and a solution to event scheduling.
- Scheduled events must be persisted
- Events can be cancelled
- Events can be rescheduled
- Events are easily traceable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import dbus | |
import dbus.exceptions | |
import dbus.mainloop.glib | |
import dbus.service | |
import array | |
import gobject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
function extractList(list, index) { | |
return list.map(function(element) { return element[index]; }); | |
} | |
function buildList(head, tail, index) { | |
return [head].concat(extractList(tail, index)); | |
} | |
function optionalList(value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will always return a promise that completes when all promises have completed | |
// because we're turning errors into successful promises (because .catch does not throw an error) | |
var allSettled = (promises) => { | |
return Promise.all(promises.map(p => { | |
return p.then(result => { | |
return { result: result, error: null } | |
}) | |
.catch(error => { | |
return { result: null, error: error } | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function RequestUserContext() {} // Used to signal request for user | |
// Understands the request for the user context | |
function runner(g, user) { | |
const generator = g() | |
let result = generator.next() | |
do { | |
if (result.value && result.value.constructor == RequestUserContext) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
process.stdin.setEncoding('utf8'); | |
var data = ''; | |
process.stdin.on('readable', function() { | |
var chunk = process.stdin.read(); | |
if (chunk !== null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
require 'json' | |
require 'time' | |
require 'syslog' | |
class Snapshot | |
def initialize() | |
@format = 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
window.onload = function () { | |
var canvas = document.getElementById('game-canvas'); | |
var context = canvas.getContext("2d"); | |
context.fillStyle = "#0000FF"; | |
var radius = 30; | |
var x = 250; |
NewerOlder