Skip to content

Instantly share code, notes, and snippets.

View othyn's full-sized avatar
🏳️‍🌈
Be kind, and have an adventure.

Ben othyn

🏳️‍🌈
Be kind, and have an adventure.
View GitHub Profile
@angela-d
angela-d / gpg-key-migration.md
Created April 1, 2018 23:57
Move GPG Keys from One Machine to Another

Migrate GPG Keys from One Workstation to Another

Replace [your key] with your key ID

To obtain your key ID

gpg --list-secret-keys --keyid-format LONG

Which returns something like

@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active April 24, 2024 15:11
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@fhuitelec
fhuitelec / check_file_exists.zsh
Created November 25, 2017 06:11
[Check file exists] Cheatsheet to check if file exists #zsh #shell #cheatsheet
#!/usr/bin/env zsh
#
# Check file exists
#
if [ ! -f /tmp/foo.txt ]; then
echo "File not found!" >&2
exit 1
fi
@troyharvey
troyharvey / deployment.yml
Last active February 27, 2024 04:47
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@j0d5
j0d5 / .swiftlint.yml
Created October 24, 2017 05:37
Swiftlint configuration file
included:
excluded:
- Pods
- Cartography
- build
disabled_rules: # rule identifiers to exclude from running
# - cyclomatic_complexity
- trailing_whitespace
@troyfontaine
troyfontaine / 1-setup.md
Last active April 24, 2024 14:19
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@andkirby
andkirby / slack.sh
Last active April 4, 2024 17:51
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@lukestanley
lukestanley / tree.py
Created June 5, 2017 10:56
Use Python's built in tk to view Python dict as a tree, with collapsing and such
# Credit to https://stackoverflow.com/a/22722889/122364
import uuid
import tkinter as tk
from tkinter import ttk
def json_tree(tree, parent, dictionary):
for key in dictionary:
uid = uuid.uuid4()
if isinstance(dictionary[key], dict):
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)