Skip to content

Instantly share code, notes, and snippets.

View jshbrntt's full-sized avatar
🏠
Working from home

Joshua Barnett jshbrntt

🏠
Working from home
View GitHub Profile
@jshbrntt
jshbrntt / config.yml
Created November 12, 2023 21:04
Kubernetes: Example HTTPS Certificate Resources
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
# Change this to your email to receive notifications about the HTTPS certificate
email: user@example.com
privateKeySecretRef:
@jshbrntt
jshbrntt / wfh_percentages.lp
Created November 9, 2022 15:50
The proportion of workers hybrid working has risen slightly during spring 2022
wfh_percentage home=34u,work=39u,hybrid=9u 1610064000
wfh_percentage home=35u,work=39u,hybrid=10u 1610668800
wfh_percentage home=34u,work=39u,hybrid=9u 1611273600
wfh_percentage home=36u,work=36u,hybrid=11u 1611878400
wfh_percentage home=36u,work=36u,hybrid=11u 1612483200
wfh_percentage home=37u,work=34u,hybrid=10u 1613088000
wfh_percentage home=35u,work=36u,hybrid=10u 1613692800
wfh_percentage home=32u,work=39u,hybrid=10u 1614297600
wfh_percentage home=36u,work=38u,hybrid=10u 1614902400
wfh_percentage home=30u,work=41u,hybrid=12u 1615507200
@jshbrntt
jshbrntt / lockdown_events.lp
Last active November 7, 2022 17:29
Timeline of UK government coronavirus lockdowns and restrictions
lockdown_event,type=PM\ /\ government\ announcements description="PM says \"now is the time for everyone to stop non-essential contact and travel\"." 1584316800
lockdown_event,type=PM\ /\ government\ announcements description="PM says the UK can \"turn tide of coronavirus\" in 12 weeks." 1584576000
lockdown_event,type=Lockdown\ restrictions\ introduced description="PM announces the first lockdown in the UK, ordering people to \"stay at home\"." 1584921600
lockdown_event,type=Legislation\ /\ emergency\ powers description="Coronavirus Act 2020 gets Royal Assent." 1585094400
lockdown_event,type=Lockdown\ restrictions\ introduced description="Lockdown measures legally come into force." 1585180800
lockdown_event,type=Lockdown\ restrictions\ introduced description="Lockdown extended for \"at least\" three weeks. Government sets out five tests that must be met before restrictions are eased." 1586991600
lockdown_event,type=PM\ /\ government\ announcements description="PM says \"we are past the peak\" of the pandemic.
@jshbrntt
jshbrntt / .wezterm.lua
Last active January 18, 2023 20:47
WezTerm Config - Windows Terminal Shortcuts
local wezterm = require 'wezterm';
local wsl_domains = wezterm.default_wsl_domains()
for idx, dom in ipairs(wsl_domains) do
dom.default_cwd = "~"
end
return {
wsl_domains = wsl_domains,
@jshbrntt
jshbrntt / grpc.js
Last active April 9, 2021 16:11
gRPC + JSON in Node.js
const process = require('process');
const grpc = require('@grpc/grpc-js');
/**
* $ node grpc.js server
*
* Server listening { port: 9001 }
* Received { request: { message: 'Hello Server!' } }
*
* $ node grpc.js client
@jshbrntt
jshbrntt / mongo-test.js
Created December 18, 2020 15:22
Create MongoDB container that starts and initializes itself as a single node replicaset
const Docker = require('dockerode');
(async () => {
const docker = new Docker();
const container = await docker.createContainer({
name: 'mongodb',
Image: 'mongo:4.0.20@sha256:dd4cbe24eb8233db92b871cc556b77efcc7f9e67bc9516579796d4d08818273e',
Cmd: [
"bash",
"-c",
{
"basics": {
"email": "joshua@barne.tt",
"label": "Professional Keyboard Slapper 👋 ⌨️ 💻",
"location": {
"city": "Cambridge",
"countryCode": "GB"
},
"name": "Joshua Barnett",
"profiles": [
@jshbrntt
jshbrntt / keybindings.json
Created June 1, 2018 13:43
VSCode Keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+cmd+]",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "shift+cmd+[",
"command": "workbench.action.terminal.focusPrevious",
@jshbrntt
jshbrntt / settings.json
Created May 31, 2018 13:44
VSCode Settings
{
"html.format.wrapAttributes": "force",
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"terminal.integrated.fontFamily": "Meslo LG S DZ for Powerline",
"files.associations": {
"Dockerfile*": "dockerfile"
},
"terminal.integrated.scrollback": 5000,
"vsicons.dontShowNewVersionMessage": true,
@jshbrntt
jshbrntt / macos-setup.md
Last active June 5, 2018 07:24
macOS Setup

macOS Fixes

# Install Homebrew (https://brew.sh/#install)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Desktop Applications
brew cask install \
  docker \
 firefox \