Skip to content

Instantly share code, notes, and snippets.

View NickCrew's full-sized avatar

Nick Ferguson NickCrew

View GitHub Profile
@NickCrew
NickCrew / Microsoft.PowerShell_profile.ps1
Created March 9, 2021 22:29
PowerShell Profile (CurrentUserCurrentHost)
# ####################################################
#
# Name: Microsoft.PowerShell_profile.ps1
# Profile: CurrentUserCurrentHost
# PSVersion: 7
#
# Profile Load Order:
# - AllUsersAllHosts
# - AllUsersCurrentHost
# - CurrentUserAllHosts
@NickCrew
NickCrew / settings.vim
Created April 8, 2021 17:44
Surfingkeys Settings
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
map('gt', 'T');
// an example to remove mapkey `Ctrl-i`
unmap('<Ctrl-i>');
@NickCrew
NickCrew / get-latest-github-release.sh
Created July 4, 2021 16:34
Get latest github release
#!/usr/bin/env bash
set -e
if [[ "$#" != "2" ]]; then
echo "USAGE:"
echo "get-latest-github-release.sh <user> <repo> [file extension] [outfile]"
exit 1
fi
repo="${1}/${2}"
@NickCrew
NickCrew / install-dots.sh
Created July 30, 2021 15:22
Install dots
#!/usr/bin/env bash
set -e
function cfg {
git --work-tree=$HOME --git-dir=$HOME/.cfg $@
}
git clone --bare https://github.com/NickCrew/dotfiles.git $HOME/.cfg
mkdir -p .config-backup
cfg checkout
@NickCrew
NickCrew / functions.ps1
Created August 19, 2021 15:03
functions.ps1
Set-Alias -Name iconda -Value Initialize-Anaconda -Force
function Initialize-Anaconda {
# !! Contents within this block are managed by 'conda init' !!
(& "${HOME}\anaconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression
}
function Send-InputTo ($target) {
# Pipe output to args of $target
@NickCrew
NickCrew / cfg-install
Created August 23, 2021 00:45
User Config Install
#!/usr/bin/env bash
DOTS_REMOTE="https://github.com/NickCrew/dotfiles.git"
DOTS_REPO="$HOME/.dots.git"
DOTS_BRANCH=master
git clone --bare $DOTS_REMOTE $DOTS_REPO
function cfg {
git --git-dir=$DOTS_REPO --work-tree=$HOME $@
@NickCrew
NickCrew / auto_syno
Last active November 6, 2021 18:26
Synology AutoFS
#!/bin/bash
# Copyright (c) 2000-2014 Synology Inc. All rights reserved.
################### NOTE ###################
#
# Adjust following settings to match your LDAP server.
#
# If using TLS or ldaps://, you have to append LDAP server's certificate to
# your client (in the file specified by tls_cacert in ldap.conf).
#
@NickCrew
NickCrew / install-tmux.sh
Created December 10, 2021 03:22
Install Tmux
#!/usr/bin/env bash
set -e
sudo apt-get update
sudo apt-get install -y bison gcc make pkg-config automake autoconf libncurses5-dev libevent-dev
mkdir -p ~/src
git clone https://github.com/tmux/tmux ~/src/tmux
@NickCrew
NickCrew / setup-python-macos.zsh
Created January 2, 2022 01:51
Setup python dev environment on macos
#!/usr/bin/env zsh
if [[ -z $ZDOTDIR ]]; then
ZDOTDIR=$HOME
fi
if ! command -v brew 1>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
@NickCrew
NickCrew / aliases.conf
Created January 4, 2022 16:35
Git CLI Aliases
[alias]
# Show git status
st = status
# Commit staged changes with editor
ct = commit
# Push to remote
pu = push
# Pull from remote
pl = pull
# Fetch remote data