Skip to content

Instantly share code, notes, and snippets.

View chrisguest75's full-sized avatar
:octocat:
Pulling & Pushing

Christopher Guest chrisguest75

:octocat:
Pulling & Pushing
View GitHub Profile
@chrisguest75
chrisguest75 / trint-fontsize-bookmarklet.md
Created January 19, 2022 20:20
Bookmarklet to increase fontsize on Trint Editor

Replace FontSize on Trint Editor

This is an unsupported bookmarklet hack to change the fontsize of the editor.

Bookmarklets Explained here

Open bookmarks in Chrome Browser. Open bookmark manager and add the following snippet inside the block as the URL.

javascript: (() => {
import random
def complex(length):
characters = []
for i in range(33, 126):
characters.append(chr(i))
password = ""
for i in range(0, length):
c = random.choice(characters)
#!/usr/bin/env bash
set -ef -o pipefail
readonly SCRIPT_NAME=$(basename "$0")
readonly SCRIPT_PATH=${0}
# shellcheck disable=SC2034
readonly SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
(return 0 2>/dev/null) && SOURCED=1 || SOURCED=0
if [[ $SOURCED == 1 ]]; then
@chrisguest75
chrisguest75 / configure_new_macos.sh
Last active February 12, 2021 07:05
Configure a new Mac
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Notes:
#
# - If installing full Xcode, it's better to install that first from the app
# store before running the bootstrap script. Otherwise, Homebrew can't access
@chrisguest75
chrisguest75 / python.json
Created May 22, 2019 13:42
VSCode Python Snippets.
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"main.py Template": {
"prefix": "main.py",
"body": [
@chrisguest75
chrisguest75 / LICENSE_GISTS
Created February 7, 2019 14:52
LICENSE for gists
Copyright 2017 Chris Guest
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
@chrisguest75
chrisguest75 / container_versions
Last active February 14, 2019 16:10
Get container versions for GCR on GCP.
#!/usr/bin/env bash
#Use !/bin/bash -x for debugging
readonly SCRIPT_NAME=$(basename "$0")
readonly SCRIPT_PATH=${0:A}
readonly SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
#****************************************************************************
#** Print out usage
#****************************************************************************
@chrisguest75
chrisguest75 / writeRaspbianSSH.sh
Last active November 4, 2018 18:22
USE AT OWN RISK: After writing Raspbian Image insert SD card into Ubuntu machine and run script to enable SSH on first boot.
#!/usr/bin/env bash
stat /media/$(whoami)/boot
result=$?
if [[ "${result}" -eq "1" ]]; then
echo "Disk is not inserted"
exit 1
fi
sudo touch /media/$(whoami)/boot/ssh
sleep 2
@chrisguest75
chrisguest75 / print_subdir_remotes
Created November 4, 2018 13:24
Output a tabulated list of child git repo remote urls. When you need to find where you cloned or pushed a repo from. Path it.
#!/usr/bin/env bash
function showremote() {
repopath="$(dirname "$1")"
pushd ${repopath} > /dev/null
url=$(git ls-remote --get-url 2>/dev/null)
result=$?
if [ $result -ne 0 ]; then
url="No remote configured"
fi