Skip to content

Instantly share code, notes, and snippets.

Dave Clark clarkdave

Block or report user

Report or block clarkdave

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@clarkdave
clarkdave / sorbet_sigil.rb
Last active Jul 3, 2019
RuboCop / Sorbet sigil rule
View sorbet_sigil.rb
# typed: true
# @prettier
require 'sorbet-runtime'
# Put this somewhere like lib/rubocop/cop/lint/sorbet_sigil.rb and then
# require it in .rubocop.yml:
#
# require:
# - ./lib/rubocop/cop/lint/sorbet_sigil.rb
@clarkdave
clarkdave / load-balanced-pgbouncer-ecs.tf
Last active Oct 3, 2018
[Terraform] Load balanced PgBouncer service on Amazon ECS
View load-balanced-pgbouncer-ecs.tf
#
# Reference implementation of a load balanced PgBouncer service on Amazon ECS
#
# see: https://engineering.loyaltylion.com/load-balanced-pgbouncer-service-on-amazon-ecs-f02120d1733e
#
resource "aws_lb" "pgbouncer" {
name = "${var.environment}-pgbouncer"
internal = true
load_balancer_type = "network"
@clarkdave
clarkdave / createPages.ts
Created Apr 15, 2018
TypeScript + Gatsby node API
View createPages.ts
import { resolve } from 'path'
import { GatsbyCreatePages } from './types'
const createPages: GatsbyCreatePages = async ({
graphql,
boundActionCreators,
}) => {
const { createPage } = boundActionCreators
const allMarkdown = await graphql(`
View multi-line-regex-grep.md
brew install pcre2

find . -type f | xargs pcregrep -M 'pattern'
@clarkdave
clarkdave / link.md
Last active Nov 14, 2017
macOS British PC keyboard layouts
View link.md
@clarkdave
clarkdave / ecs-task-events-to-cloudwatch-logs.py
Created Jun 29, 2017
(AWS Lambda) Send ECS Task events to CloudWatch Logs
View ecs-task-events-to-cloudwatch-logs.py
# This lambda function can be linked with CloudWatch events to send Task state changes to
# a CloudWatch Logs stream
#
# This is highly recommended as, in my experience, the API does *NOT* return all state change
# events; this is the only way to reliably see them all
import os
import time
import json
import boto3
@clarkdave
clarkdave / bootstrap-chef-server-12.sh
Last active Jun 29, 2017
[CHEF] Bootstrap a Chef Server 12
View bootstrap-chef-server-12.sh
#!/bin/bash -ex
# Use this script template to bootstrap a Chef Server (version 12)
#
# - bootstraps the Chef server using chef-solo and the official chef-server cookbook
# (https://github.com/chef-cookbooks/chef-server)
# - uses Lego (acme client) to generate and renew an SSL certificate for the server
# - installs the manage (web ui), push jobs and reporting addons (free for < 25 nodes)
# - configures a few sane defaults (no sign ups from web ui)
#
@clarkdave
clarkdave / ecs-interactive-console.sh
Last active May 29, 2019
ecs-interactive-console
View ecs-interactive-console.sh
#!/bin/bash -e
##
# Use this annotated script a base for launching an interactive console task on Amazon ECS
#
# more info: https://engineering.loyaltylion.com/running-an-interactive-console-on-amazon-ecs-c692f321b14d
#
# Requirements:
# - `jq` must be installed on both the client and server
##
View keybase.md

Keybase proof

I hereby claim:

  • I am clarkdave on github.
  • I am clarkdave (https://keybase.io/clarkdave) on keybase.
  • I have a public key ASAAW7KQ7BqcEQjDD--DhGxAF_Ufz_IT71BmARZuxJotRwo

To claim this, I am signing this object:

@clarkdave
clarkdave / sublimetext3.json
Created Nov 10, 2015
sublime text 3 config
View sublimetext3.json
{
"auto_find_in_selection": true,
"base64fold_all_uris": false,
"bold_folder_labels": false,
"caret_style": "blink",
"color_scheme": "Packages/User/SublimeLinter/Blackboard (SL).tmTheme",
"enable_tab_scrolling": false,
"fade_fold_buttons": false,
"find_selected_text": true,
"font_face": "Source Code Pro Light",
You can’t perform that action at this time.