Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
Eleventy:cmd command: eleventy { _: [], quiet: null, version: false, watch: false, dryrun: false, help: false, serve: false, incremental: false, 'ignore-initial': false } +0ms
Eleventy:EventBus Setting up global EventBus. +0ms
Eleventy:UserConfig Resetting EleventyConfig to initial values. +0ms
Eleventy:UserConfig Adding universal filter 'slug' +2ms
Eleventy:UserConfig Adding universal filter 'slugify' +0ms
Eleventy:UserConfig Adding universal filter 'url' +0ms
Eleventy:UserConfig Adding universal filter 'log' +0ms
Eleventy:UserConfig Adding universal filter 'serverlessUrl' +0ms
Eleventy:UserConfig Adding universal filter 'getCollectionItemIndex' +0ms
Eleventy:UserConfig Adding universal filter 'getCollectionItem' +0ms
@duffn
duffn / metrics-server-for-tilt.yaml
Created September 23, 2021 13:44
Kubernetes metrics-server for Tilt
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@duffn
duffn / test-data-json.json
Last active April 26, 2020 14:09
Gatsby YAML Recipe Files
[
{
"name": "Leia Organa",
"profession": "Princess"
},
{
"name": " Luke Skywalker",
"profession": "Jedi Knight"
},
{
@duffn
duffn / ecto_helper.ex
Created January 27, 2020 15:33
Ecto helper for error formatting
# https://thebrainfiles.wearebrain.com/prettify-ecto-errors-b85e9a7977f6
defmodule EdgeBuilder.EctoHelper do
@moduledoc """
Provides helper functions
"""
@doc """
Prettifies changeset error messages.
By default `changeset.errors` returns errors as keyword list, where key is name of the field
@duffn
duffn / github_prs.sh
Last active December 29, 2019 17:59
Get GitHub PRs from commits between two branches
export STAGING=staging
export MASTER=master
export REPO=https://github.com/yourorg/yourrepo/pull/
git log --oneline $(git log -n 1 --pretty=format:"%H" $STAGING)...$(git log -n 1 --pretty=format:"%H" $MASTER) | grep -E '#[0-9]+' | gawk -v REPO="$REPO" 'match($0, /#([0-9]+)/, arr) {$1=""; print substr($0,2) "\t" REPO arr[1]}'
@duffn
duffn / periodTrigger.groovy
Created July 19, 2019 13:36
Update a Scan Repository Trigger in a Jenkins GitHub Cloudbees folder
// Update the PeriodicFolderTrigger of each job inside of a Cloudbees folder.
// Useful for updating individual repos as you cannot do this through the UI.
// https://stackoverflow.com/questions/57077851/jenkins-github-plugin-scan-organization-triggers
import com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger
import jenkins.model.Jenkins
import jenkins.branch.OrganizationFolder
println "Multibranch Items\n-------"
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject.class).each { it.triggers
.findAll { k,v -> v instanceof com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger }
@duffn
duffn / dracula-refined.css
Created March 16, 2019 18:48
Dracula Theme for GitHub with Refined GitHub
.blob-code-inner {
font-family: 'Hack', Menlo, monospace;
font-size: 16px;
}
.blob-code-inner span.pl-k {
color: #FF79C6;
}
.blob-code-inner span.pl-c1,
@duffn
duffn / s3_public_bucket_policy.json
Last active September 8, 2018 03:11
S3 Public Bucket Policy
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::example.com/*"]
}]
}
@duffn
duffn / keybase.md
Created September 1, 2018 11:57
Keybase

Keybase proof

I hereby claim:

  • I am duffn on github.
  • I am duffn (https://keybase.io/duffn) on keybase.
  • I have a public key whose fingerprint is 8F29 B3DB 69FE 0961 A8E4 4AC5 3459 9F4A AC3B 4C9E

To claim this, I am signing this object:

@duffn
duffn / mysql_docker_buffalo.txt
Created August 31, 2018 11:06
MySQL in Docker with Buffalo
# MySQL in Docker
docker run --name=mysql01 -p 3306:3306 mysql/mysql-server:latest
docker exec -it mysql01 mysql -uroot -p
# Enter the one time password generated from the docker run command
# and then change the root password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypassword';
# Create a user with your host IP address so it can connect from Buffalo
# outside the container
create user 'root'@'172.17.0.1' with password 'mypassword';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'172.17.0.1';