Skip to content

Instantly share code, notes, and snippets.

View TheLandolorien's full-sized avatar

Lando Toothman TheLandolorien

View GitHub Profile
@TheLandolorien
TheLandolorien / connectwifipi.sh
Created December 14, 2017 13:11
Raspberry Pi Wi-Fi Configuration Script via wpa_supplicant.conf
#!/bin/bash
usage() {
echo ""
echo "Raspberry Pi Wi-Fi Configuration Script"
echo "====================================================================="
echo "This script stores a secure version of your Wi-Fi network password"
echo "and automatically configures your Raspberry Pi to connect to the "
echo "provided Wi-Fi network name."
echo ""
@TheLandolorien
TheLandolorien / git-pull-pr.sh
Created August 29, 2018 17:54
Pull GitHub PR based on Branch and PR#
#!/bin/bash
if [[ "$#" -eq 2 ]]; then
TARGET_BRANCH="$1"
ID="$2"
BRANCH_NAME="PR-${ID}"
git checkout $TARGET_BRANCH
git branch -D $BRANCH_NAME
git fetch upstream pull/$ID/head:$BRANCH_NAME
@TheLandolorien
TheLandolorien / git-remove-files-from-commit.sh
Created August 29, 2018 18:02
Remove files from previous git commit
#--------------------------------------------------
# How to Split git commits
#--------------------------------------------------
# Checkout specific commit
git cherry-pick <commit>
# Reset to previous commit
git reset --soft HEAD^
@TheLandolorien
TheLandolorien / git-commits-log-formatter.sh
Last active September 10, 2021 19:00
Configure git to pretty print logs
git config --global alias.commits "log --abbrev-commit --pretty=format:'%C(red)%h%Creset -%C(yellow)%d%Creset %s %C(green)%cd (%cr)%Creset %C(bold blue)<%an>%Creset' --date=format:'%a %b %d, %Y %H:%M %p'"
@TheLandolorien
TheLandolorien / proxy.sh
Created August 29, 2018 18:14
Bash Proxy Script for Corporate Networks
#!/bin/bash
PROXY=<PROXY>
BYPASS_PROXY="localhost,127.0.0.1,<BYPASS_PROXY>"
ENTERPRISE_GITHUB="<ENTERPRISE_GITHUB>"
if [[ "$1" = "on" ]]; then
# Configure CLI Proxy Settings for Corporate Network
echo -n "Turning on proxy..."
@TheLandolorien
TheLandolorien / Sublime Text.xml
Created August 29, 2018 18:15
PyCharm (IntelliJ) Sublime Text Based Keymap
<keymap version="1" name="Sublime Text" parent="Mac OS X 10.5+">
<action id="AddToFavoritesPopup" />
<action id="ChangesView.Diff" />
<action id="CheckinProject" />
<action id="CompareTwoFiles" />
<action id="Console.TableResult.CloneRow" />
<action id="Console.TableResult.NavigateAction">
<keyboard-shortcut first-keystroke="f4" />
</action>
<action id="Database.OpenDbStorageAction">
const jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
$ = jQuery.noConflict();
const delay = ms => new Promise(res => setTimeout(res, ms));
var startingIndex = 0;
var delayInSeconds = 2;
#!/bin/bash
CONFIG_PATH="${HOME}/.inaudible/"
TABLES_PATH="${CONFIG_PATH}/tables/"
usage() {
echo "Usage: ${BASH_SOURCE[0]} <BOOK_FILE|BOOKS_DIRECTORY>"
if [[ ! -z "$1" ]]; then
echo ""
@TheLandolorien
TheLandolorien / .bash_path_additions
Last active July 30, 2021 15:17
Bash PATH Safe Additions
# Add new directories to PATH without duplicating on shell reload
# e.g. `source ~/.bash<SCRIPT_SUFFIX>`
[[ ":$PATH:" =~ ":<PATH_ADDITION>:" ]] || PATH="<PATH_ADDITION>:$PATH"
User sfdxUser = [SELECT Id, Name, TimeZoneSidKey, UserPreferencesLightningExperiencePreferred FROM User WHERE Name='User User' LIMIT 1];
sfdxUser.TimeZoneSidKey = 'America/New_York';
update sfdxUser;