Skip to content

Instantly share code, notes, and snippets.

@andkirby
andkirby / bashrc_init_install.sh
Last active August 17, 2020 12:17
Install .bashrc init code
#!/usr/bin/env bash
###################################
# Init content for .bashrc file
#
# curl -Ls https://gist.github.com/andkirby/0e2982bee321aa611bc66385dee5f399/raw/bashrc_init_install.sh | bash
# curl -Ls https://bit.ly/bash-init | bash
###################################
touch ~/.bashrc
if cat ~/.bashrc | grep '# Init .bashrc content' > /dev/null; then
echo "notice: You have updated .bashrc file." > /dev/stderr
@andkirby
andkirby / git-downloader
Last active June 25, 2020 17:12
Downloader for Git Bash for Windows
#!/usr/bin/env bash
##################################################################
# Automatically download Git Bash for Windows portable version #
##################################################################
# Quick running:
# curl -Ls https://gist.githubusercontent.com/andkirby/16e3c7e4be8bac4c6b3bd0ae8f713552/raw/git-downloader | bash
##################################################################
@andkirby
andkirby / clip_read_write_test.ahk
Created January 30, 2020 12:29
AutoHotKey. Test reading rich text from a file
#ClipboardTimeout 2000
#SingleInstance force
; Working example
; You may test in some wysiwyg editor
; Win + R — Write clipboard
#r::
{
ClipWait
@andkirby
andkirby / fetch-all-xsd.sh
Last active August 29, 2019 14:44
Download all Amazon MWS XSD files recursively.
#!/usr/bin/env bash
#############################################################################
# Download Amazon MWS XSD file with all included ones recursively
# It will download XSD files into the same directory of this script
#############################################################################
# USAGE
# $ bash fetch-all-xsd.sh URL_START_XSD_FILE
#
# EXAMPLE
# $ bash fetch-all-xsd.sh https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/amzn-envelope.xsd
@andkirby
andkirby / ruby-bash-win.sh
Last active January 17, 2019 12:11
Fetch Ruby interpreter from GitBash for Windows or Cygwin similar CLI.
#!/usr/bin/env bash
################################################################################
# This script can install RUBY binaries on Windows in Bash.
#
# Link to this file:
# https://gist.github.com/andkirby/caf9e825e83f38ad98721956d6e0107c/raw/ruby-bash-win.sh
#
# Download latest version by command in GitBash Windows console:
# $ curl -Ls bit.ly/ruby-bash-win | bash
#
@andkirby
andkirby / bash-magento2-autocomplete-install.sh
Last active November 6, 2018 04:55
Magento 2.x binary file auto-complete installation in Bash CLI.
#!/usr/bin/env bash
###################################
# Auto-complete for Magento2 console "bin/magento" file
#
# Download and install:
# $ curl -Ls https://gist.github.com/andkirby/76c5f09d8c6bd55d0fe21a906d72defe/raw/bash-magento2-autocomplete-install.sh | bash
#
# MANUAL INSTALLATION
# "bash-completion" installation:
# $ yum install -y bash-completion
#!/usr/bin/env bash
# Script for testing options
set -o pipefail
set -o errexit
set -o nounset
#set -o xtrace
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@andkirby
andkirby / docker-uninstall.sh
Created July 24, 2017 13:49
Uninstall script for opal-satis containers.
#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
#set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
@andkirby
andkirby / .bashrc_git.sh
Last active July 17, 2017 16:24
Short aliases for GOT
# ---- GIT ----
#alias git="/d/prog/git/bin/git.exe"
# Git status
alias gg="git status -uno"
# Re-add files (refresh cache)
#alias gau='git status -s | cut -c4- | xargs git add'
alias gau="git diff --name-only --cached | xargs -I '{}' realpath --relative-to=. $(git rev-parse --show-toplevel)/'{}'"
# Re-add files (refresh cache) and commit
alias gc="gau && git commit -m"
alias gl='git log -3'
@andkirby
andkirby / .gitconfig
Last active June 29, 2017 12:40
Sample of global .gitconfig.
[user]
name =
email =
[push]
default = current
[core]
excludesfile = ~/.gitignore
editor = vim
autocrlf = input
eol = lf