Skip to content

Instantly share code, notes, and snippets.

@QinMing
QinMing / .zshrc
Last active March 10, 2024 22:17
.zshrc (lazy loading shell functions)
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
lazy_load() {
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it.
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time
# $1: space separated list of alias to release after the first load
# $2: file to source
# $3: name of the command to run after it's loaded
# $4+: argv to be passed to $3
@fpytloun
fpytloun / venv.sh
Last active May 28, 2016 09:22
Simple Python virtualenv wrapper
#!/bin/bash
VENV_HOME=${VENV_HOME:-$HOME/virtualenv}
SHELL=${SHELL:-/bin/zsh}
exit_err() {
echo "[ERROR] $1" 1>&2
exit 1
}
@christophermanning
christophermanning / README.md
Last active November 22, 2022 22:14
Bitbucket Download Directory

Python script to download/shallow clone the files of a directory at bitbucket. This is useful when you just want a copy of the files in a subdirectory of a repository without needing mercurial or having to download the entire repository.