Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar

Hunter T. StrangeRanger

View GitHub Profile
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active September 10, 2023 22:40
Adding & Updating GitHub Access Token on Mac
View add-update-refresh-github-access-token-on-mac.md

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

@jesugmz
jesugmz / Python-docstring-restructuredtext-style.rst
Last active August 15, 2023 10:38
Python docstring reStructuredText style
View Python-docstring-restructuredtext-style.rst
@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active September 23, 2023 23:40
Script to remove all videos from Youtube Watch Later playlist
View Remove videos from Youtube Watch Later playlist.md

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();
@Luzifer
Luzifer / README.md
Last active August 16, 2023 14:24
Running docker-compose as a systemd service
View README.md

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
View get_latest_release.sh
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
View Good-CONTRIBUTING.md-template.md

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@vladignatyev
vladignatyev / progress.py
Last active June 28, 2023 08:38
Python command line progress bar in less than 10 lines of code.
View progress.py
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# 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:
#
@thomd
thomd / LC_COLORS.md
Last active September 4, 2023 10:05
LSCOLORS & LS_COLORS
View LC_COLORS.md

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@todgru
todgru / starttmux.sh
Last active August 5, 2023 02:25
Start up tmux with custom windows, panes and applications running
View starttmux.sh
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"