Skip to content

Instantly share code, notes, and snippets.

View iamkirkbater's full-sized avatar

Kirk Bater iamkirkbater

View GitHub Profile
@iamkirkbater
iamkirkbater / macros.forms.twig
Created April 5, 2016 15:00
Twig Macros for forms. Uses an array of attributes instead of 400 separate parameters for separate values. Also abstracts HTML5 text types for ease of reading in your template files.
{% macro input(name, value, type, attributes) %}
<input name="{{ name }}" type="{{ type }}" value="{{ value }}"{% for attr, value in attributes %} {{ attr }}="{{ value }}"{% endfor %}{% if not attributes.id is defined %} id="{{ name }}"{% endif %}/>
{% endmacro %}
{% macro text(name, value, attributes) %}
{% from _self import input %}
{{ input(name, value, "text", attributes) }}
{% endmacro %}
{% macro password(name, value, attributes) %}
#!/bin/bash
set -o pipefail
REGIONS=("us-east-1" "eu-west-1" "us-west-2" "us-east-2")
usage() {
cat <<EOF
usage: $0 [ OPTIONS ] --role [role-name]
Options
@iamkirkbater
iamkirkbater / getCurrentlyPlaying.scpt
Last active December 8, 2023 22:35
Applescript - Get Currently Playing Track information from Apple Music and write to file
use scripting additions
use framework "Foundation"
-- Set Configuration Defaults
set OUTPUT_FILE to "~/now-playing.json"
-- END Configuration
on getCurrentTrack()
@iamkirkbater
iamkirkbater / obs_virtual_camera.applescript
Last active December 8, 2023 22:07
Launches OBS, starts the virtual camera, and then minimizes the window.
on run {input, parameters} -- remove this line if running in Script Editor and not with Automator
tell application "OBS" to activate
tell application "System Events"
tell process "OBS"
set frontmost to true
if name of every menu item of menu "Tools" of menu bar 1 contains "Start Virtual Camera" then
click menu item "Start Virtual Camera" of menu "Tools" of menu bar 1
end if
click (first button of window 1 whose role description is "minimize button")
end tell
#!/bin/bash
set -o pipefail
usage() {
cat >&2 <<EOF
usage: $0 stringWith@@PLATFORM@@toReplace --ARMARCH --X86ARCH [ OPTIONS ]
requires one of each of the x86 arch options below and arm arch options below.
@iamkirkbater
iamkirkbater / autoSizr.js
Created August 6, 2014 13:45
Simple jQuery Plugin that auto resizes text to fill a specific sized div (great for responsive slideshows that utilize large banner text with variable lengths), derived from https://gist.github.com/iam4x/5015270
$.fn.autoSizr = function () {
var el, elements, _i, _len, _results;
elements = $(this);
if (elements.length < 0) {
return;
}
_results = [];
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i];
_results.push((function(el) {
@iamkirkbater
iamkirkbater / kirks_keymap.json
Last active July 19, 2021 17:43
DZ60 QMK Split Spacebar Configuration
{
"version": 1,
"notes": "",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "dz60",
"keymap": "kirks_keymap",
"layout": "LAYOUT",
"layers": [
[
"KC_GRV",
type ReconcileAccount struct {
Client kubeclient.Client
scheme *runtime.Scheme
OperatorAWSClient awsclient.Client
AccountAWSClient awsclient.Client
Account awsv1alpha1.Account
LinkedAccountClaim awsv1alpha1.AccountClaim
Logger LogInterface
}
@iamkirkbater
iamkirkbater / scaffold.sh
Last active May 7, 2020 18:06
A quick options set and verbosity output scaffold for new bash scripts
#!/bin/bash
usage() {
cat <<EOF
usage: $0 [ OPTIONS ]
Options
-d --dry-run Do not make any modifications but preview the expected operations
-h --help Show this message and exit
-q --quiet Be Quiet
-v --verbose Be Loud
resource "aws_acm_certificate" "cert" {
domain_name = "*.${var.domain_name}"
validation_method = "DNS"
lifecycle {
create_before_destroy = true
}
}
data "aws_route53_zone" "zone" {