This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: UTF-8 -*- | |
# Note: A newer version of this script is located at https://github.com/trustin/smi2ass | |
# | |
# Copyright (C) 2018 Trustin Heuiseung Lee and other contributors | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
log() { | |
echo -en '\033[1;32m' | |
echo -n "$@" | |
echo -e '\033[0m' | |
} | |
choice() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
HEAD_COMMIT_ID=$(git rev-parse HEAD) | |
if [[ -n "$HEAD_COMMIT_ID" ]]; then | |
git commit --amend --reuse-message="$HEAD_COMMIT_ID" | |
git push --force | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Git-aware bash command prompt | |
# | |
# Put this script at $HOME/.bash_prompt and add the following to your .bashrc: | |
# | |
# if [[ -f "$HOME/.bash_prompt" ]]; then | |
# if [[ -z "$PROMPT_COMMAND" ]]; then | |
# PROMPT_COMMAND="$HOME/.bash_prompt" | |
# else | |
# PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ;} $HOME/.bash_prompt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Stash the staged files if any. | |
NEEDS_UNSTASH=0 | |
if ! git diff --staged --exit-code >/dev/null; then | |
echo -ne '\033[1;32m' | |
echo -n 'Stashing the staged files' | |
echo -e '\033[0m' | |
git stash | |
NEEDS_UNSTASH=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
if [[ $# -gt 1 ]]; then | |
while [[ $# -gt 0 ]]; do | |
"$0" "$1" | |
shift | |
done | |
exit 0 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devices: ({ | |
name: "MX Anywhere 3"; | |
hiresscroll: { | |
hires: true; | |
invert: false; | |
target: false; | |
up: { | |
mode: "Axis"; | |
axis: "REL_WHEEL_HI_RES"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
if [[ -z "${JAVA_HOME:-}" ]]; then | |
JAVA='java' | |
else | |
JAVA="$JAVA_HOME/bin/java" | |
fi | |
SJK_VERSION='0.20' | |
SJK_PATH="$HOME/.local/opt/sjk/sjk-plus-$SJK_VERSION.jar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
echo_and_run() { | |
echo "> $*" | |
"$@" | |
} | |
setup_sudo() { | |
# Ask for the administrator password upfront |