Skip to content

Instantly share code, notes, and snippets.

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

Cole Mackenzie cmackenzie1

🏠
Working from home
View GitHub Profile
@cmackenzie1
cmackenzie1 / git.md
Created February 6, 2024 19:28
My favorite git commands

Copy last commit message to clipboard

git log -1 --pretty=%B | pbcopy # Can also specify -2 for last two messages. 

Is it master or main?

git branch -l master main
@cmackenzie1
cmackenzie1 / deltalake_schemas.yaml
Created June 15, 2023 16:24
Define Delta Lake table schemas in YAML.
# A top-level `type: struct` is a `Schema`
# These can be serialized into a deltalake::Schema struct using serde_yaml in rust
# let schema: deltalake::Schema = serde_yaml::from_str(r#"<your yaml>");
---
# A struct with primitive fields
type: struct
fields:
- name: String
type: string
nullable: true
@cmackenzie1
cmackenzie1 / cloudflare_logpush.tf
Last active May 11, 2022 17:55
Cloudflare + Terraform example for configuring Logpush Jobs to R2. https://developers.cloudflare.com/logs/get-started/enable-destinations/r2/
# https://developers.cloudflare.com/logs/get-started/enable-destinations/r2/
data "cloudflare_api_token_permission_groups" "all" {
resource "cloudflare_api_token" "logpush_r2_token" {
name = "logpush_r2_token"
policy {
permission_groups = [
data.cloudflare_api_token_permission_groups.all.permissions["Workers R2 Storage Write"],
@cmackenzie1
cmackenzie1 / Lightroom Manifesto.md
Last active March 23, 2023 04:12
My cheatsheet / quick guide to using Adobe Lightroom.

Lighroom Manifesto ✊

🚩 Flags:

Assign flags right after an import to filter out the obviously bad shots and ones you'd like to keep. Use your first instinct and leave undecided ones as unflagged.

  • Pick (P): In focus, eyes open, good positioning
  • Reject (X): Out of focus, blurry motion, eyes closed
  • Unflag (U):
@cmackenzie1
cmackenzie1 / build.gradle.kts
Last active March 4, 2021 04:27
Gradle dependency for Expedia GraphQL
implementation("com.expediagroup:graphql-kotlin-spring-server:3.7.0")
@cmackenzie1
cmackenzie1 / docker-compose.yml
Last active January 20, 2024 09:58
Docker Compose for DynamoDB Local and Admin UI
version: '3.7'
services:
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
ports:
- "8000:8000"
dynamodb-admin:
image: aaronshaf/dynamodb-admin
print("Hello, World!)
#!/bin/bash
#
# Inspects branch name and checks if it begins with a Jira ticket number (i.e. ABCD-123).
# If yes, commit message will be automatically prepended with [ABCD-123].
# Resources:
# - https://gist.github.com/bartoszmajsak/1396344
# - https://stackoverflow.com/questions/34213120/find-branch-name-during-git-rebase
# - https://github.com/typicode/husky/issues/311#issuecomment-580237182
# - https://gmurphey.github.io/2013/02/02/ignoring-git-hooks-when-rebasing.html#.XkK1AhNKjOQ
@cmackenzie1
cmackenzie1 / config.ssh
Created August 13, 2019 21:13
SSH Tunnel / Bastion Hop config example
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
# Helps prevent timeout of connections due to inactivity
ServerAliveInterval 30
TCPKeepAlive yes
# Use key forwarding so I don't have to put my private key on the servers
@cmackenzie1
cmackenzie1 / install-docker.sh
Last active April 18, 2018 01:05
CentOS 7 Docker Userdata
# Update packages
yum update -y --security
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
cat << EOF > /etc/yum.repos.d/centos-extras.repo
[centos-extras]
name=centos
baseurl=http://mirror.centos.org/centos/7/extras/x86_64/
gpgcheck=0
enabled=1