Skip to content

Instantly share code, notes, and snippets.

View designfrontier's full-sized avatar

Daniel Sellers designfrontier

View GitHub Profile
#!/usr/bin/env bash
# https://id.atlassian.com/manage-profile/security/api-tokens
# for getting your tokens :pointup:
GIT_MESSAGE=$(git log -n 1)
read -p "Brief Summary:" SUMMARY
read -p "Description:" DESCRIPTION
echo ""
echo 'Please enter ticket type: '
select T in "${JIRA_TICKET_TYPES[@]}"
do
@designfrontier
designfrontier / enforce-test-file-changes
Created October 22, 2021 22:25
A simple way to enforce that changes to js/ts files require changes to their corresponding test files in legacy code bases where you are trying to expand code coverage over time.
#!/usr/bin/env node
const IGNORE_FILES = [];
const filesToParse = JSON.parse(process.env.files);
const filesThatNeedTests = filesToParse.filter((f) => {
const fileNameArray = f.split('.');
if (IGNORE_FILES.includes(f)) {
return false;
}
[user]
name = Daniel Sellers
[color]
ui = true
[alias]
co = checkout
cob = checkout -b
st = status
ci = commit
br = branch
@designfrontier
designfrontier / enforce-package-lock
Created May 12, 2021 21:09
node script that returns non-zero exit code if dependencies are updated but not the lock file
#!/usr/bin/env node
const cp = require('child_process');
const pkg = require('../package.json');
const filesToParse = JSON.parse(process.env.files);
const checkPackageJSON = () => {
const s = cp.execSync('git diff HEAD~1 HEAD package.json').toString();
const changedLines = s
.match(/[+]( ){2,4}.*/g)
@designfrontier
designfrontier / aws-auth-error-decode
Created March 17, 2021 20:51
aws-auth-error-decode
#!/usr/bin/env bash
aws sts decode-authorization-message --encoded-message "$1" --query DecodedMessage --output text | jq '.'
#!/usr/bin/env bash
string="{\"$2\": \"$3\"}"
mount=$1
vault write $mount @<(vault read -format json $mount | jq ".data + $string")
@designfrontier
designfrontier / slackme
Last active December 3, 2018 16:20
Pipe to Slack
#!/usr/bin/env node
const http = require('https');
const url = process.env.SLACK_URL;
let data;
process.stdin.resume();
process.stdin.setEncoding('utf8');
@designfrontier
designfrontier / subl-patch
Created March 14, 2018 02:14
opens all of the files that have changed between where you are in git and HEAD on master in sublime. Handy
#!/usr/bin/env node
const cp = require('child_process');
cp.exec('git diff --name-only master HEAD', (err, out) => {
const files = [].concat('subl', '.', out.split('\n')).join(' ');
cp.exec(files, (e, o) => {
if (e) {
console.log(e, 0);
process.exit(1);
@designfrontier
designfrontier / foresight.sh
Last active January 31, 2017 17:04
foresight: A way to find major owners of files you have changed in your commit
#!/usr/bin/env bash
set -e
function ADD_AUTHOR {
local author_to_add=$1
if ! [ -z "${author_to_add}" ]; then
#add something to add people to review in your source repo
fi
@designfrontier
designfrontier / lone-star.zsh-theme
Last active September 20, 2016 12:22
Lone Star zsh
#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
#
# Lone Star - A futuristic minimal awesome Texas inspired theme for zsh
#
# Based heavily on the pure theme which includes the following note:
#
# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge
# thanks goes out to him for designing the fantastic Pure prompt in the first