Skip to content

Instantly share code, notes, and snippets.

View aclarknexient's full-sized avatar

Anthony Jarvis-Clark aclarknexient

  • Launch by NTT Data
  • Ann Arbor, Michigan
View GitHub Profile
@veebch
veebch / gist:e925cbd977ee205c0e495c98a2791352
Last active November 16, 2024 23:56
A single command to invoke a fzf interface that generates playlists from a subset of music added to a directory in the last 10 days
# Find directories in music folder modified in last 240 hours
fd . '/path/to/music/' \
--changed-within "240h" \
--min-depth 2 \
-d 2 \
| \
# Remove any paths containing @ symbol (Synology NAS quirk)
rg -v '@' \
| \
@tekknolagi
tekknolagi / lines.py
Last active September 10, 2024 20:03
#!/usr/bin/env python
import multiprocessing
import random
import time
class Logger:
def __init__(self, num_lines, last_output_per_process, terminal_lock):
self.num_lines = num_lines
@aclarknexient
aclarknexient / shortcuts.md
Last active August 5, 2023 22:56
Readline shortcuts

Readline Keyboard Shortcuts

Copied from the readline documentation.

For MacOS, replace Ctrl with Cmd, and Meta with Option.

Shortcut Comment
Ctrl+A Beginning of line
Ctrl+B / Backward one character
@ursulacj
ursulacj / Create-branch-with-Github-API.md
Last active June 26, 2024 17:23 — forked from auwsome/Create-branch-with-Github-API.md
Create a branch on Github using API and Python

Create a branch on Github using API and Python

Created as a module that can be imported or run. Requires built in JSON, requests, and datetime modules.

Allows you to clone a branch on Github using the Github Git Database API Endpoints.

Forked Gist from:

  • auwsome/Create-branch-with-Github-API.md

See:

@edenwaith
edenwaith / MarkUnreadEmails.scpt
Last active December 3, 2024 12:15
An AppleScript to go through the mailboxes in Outlook and mark unread messages as read
-- File: MarkUnreadEmails.scpt
-- Description: Go through the mailboxes in Outlook and mark unread messages as read
-- Author: Chad Armstrong
-- Date: 22 November 2019
tell application "Microsoft Outlook"
set myInbox to folder "Inbox" of default account
set github to folder "GitHub" of myInbox
set other to folder "Other" of myInbox
@activeshadow
activeshadow / remove-waf-rules.sh
Created February 14, 2019 21:04
Remove AWS WAF Rules
#!/bin/bash
RULES=$(aws waf list-rules | jq -r ".Rules[] | .RuleId")
for rule in $RULES; do
TOKEN=$(aws waf get-change-token | jq -r .ChangeToken)
PRED=$(aws waf get-rule --rule-id $rule | jq ".Rule.Predicates[0]")
aws waf update-rule --cli-input-json '{"RuleId": "'$rule'", "ChangeToken": "'$TOKEN'", "Updates": [{"Action": "DELETE", "Predicate": '"$PRED"'}]}'
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active December 26, 2024 00:04
set -e, -u, -o, -x pipefail explanation
@aasmith
aasmith / nested-json.sh
Created September 19, 2017 21:23
How to decode nested json with jq
# Typical use-case is decoding an AWS STS message. The DecodedMessage key contains escaped JSON.
jq '.DecodedMessage | fromjson | .' message.json
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active November 18, 2024 08:50
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@Dyrcona
Dyrcona / quickpick
Last active August 9, 2024 13:47
A bash script to batch git cherry-pick of many commits from a single source branch. It can become a new git command if you save it in your path with a name like git-quickpick. Then, you can run it like so `git quickpick foo/bar'. Very handy, that.
#!/bin/bash
# Author: Thomas Berezansky <[email protected]>
# Author: Jason Stephenson <[email protected]>
#
# Feel free to use and to share this script in anyway you like.
# This script is intended as a shortcut for the git cherry-pick
# command when you have several commits that you want to cherry-pick
# into your local branch from another branch. It often results in a