Skip to content

Instantly share code, notes, and snippets.

import asyncio
import logging
import subprocess
import httpx
from aiozeroconf import ServiceBrowser, Zeroconf
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s: %(message)s")
logger = logging.getLogger(__name__)
@weargoggles
weargoggles / what-if.md
Last active January 15, 2022 09:40
a software manifesto for the 2020s

Some axioms and maxims for software development in the 2020s:

  1. Computers are faster and have more memory than you think.
  2. Piling on libraries, databases or sidecars uses up more of that time and space than you think.
  3. Networks are slower and serialization is more costly than you think.
  4. If we can find a solution which runs on one computer, we can avoid the cost and complexity of distributed computing.
  5. It's easier to make Good Software™ when it runs on one computer.
  6. Running the same software on more computers for redundancy or performance reasons is sometimes a good idea, but it's a different thing.
  7. Modules are great but 99.99% of the time they don't require a new Git repository.
  8. Modules are great but 99.99999% of the time calling that module over the network is a bad idea (see #1 and #3).
"use strict";
var LAB = /(?:^|\.)lab\.cloud\.ecg\.so$/;
var CLOUD = [
/(?:^|\.)ix3-control\.cloud\.ecg\.so$/,
/(?:^|\.)dus2-control\.cloud\.ecg\.so$/,
/^172\.16\./,
/^172\.18\./,
/(?:^|\.)ams1\.cloud\.ecg\.so$/,
/(?:^|\.)dus1\.cloud\.ecg\.so$/,
{"keyboard":"dz60","keymap":"dz60_default","layout":"LAYOUT_60_iso","layers":[["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_BSPC","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","KC_LCTL","KC_LALT","KC_LGUI","KC_SPC","KC_RGUI","KC_LCTL","MO(1)","KC_RCTL"],["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_NO","KC_NO","RESET","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC

JSON Batch Event Format for CloudEvents - Version 0.1

Abstract

The JSON Batch Format for CloudEvents defines how a batch of events is expressed in JavaScript Object Notation (JSON) Data Interchange Format ([RFC8259][RFC8259]), based on the inner JSON Event Format

Status of this document

data "consul_catalog_service" "consul" {
name = "consul"
}
data "template_file" "consul_join_configuration" {
template = "${file("${path.module}/templates/consul_join.json")}"
vars {
service = "${jsonencode(data.consul_catalog_service.consul.service.*.address)}"
}
class OfficeUpdateUserSerializer(serializers.Serializer):
# http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
id = serializers.UUIDField(null=True)
first_name = serializers.CharField()
last_name = serializers.CharField()
email = serializers.EmailField()
role = serializers.CharField(choices=User.ROLES)
active = serializers.BooleanField(default=True)
class OfficeUpdateSerializer(serializers.Serializer):
@weargoggles
weargoggles / shapes.glsl
Created August 11, 2017 07:56
shader book shapes
// Author @patriciogv - 2015
// http://patriciogonzalezvivo.com
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
[general]
state_file = /var/awslogs/state/agent-state
[/var/log/syslog]
file = /var/log/syslog
log_group_name = /var/log/syslog
log_stream_name = {instance_id}
datetime_format = %b %d %H:%M:%S

Keybase proof

I hereby claim:

  • I am weargoggles on github.
  • I am weargoggles (https://keybase.io/weargoggles) on keybase.
  • I have a public key whose fingerprint is 1DE0 215A 7D4A C7E6 47A1 DFE2 0DCF 4672 4099 6911

To claim this, I am signing this object: