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 | |
| # Claude Code statusline command script | |
| # Gist link: https://gist.github.com/QinMing/2a7861418cc0e80b1f0c72eef136d309 | |
| # When committing changes to this file, also update the gist. | |
| # Read JSON input from stdin | |
| input=$(cat) | |
| # --------------------------------------------------------------------------- | |
| # Extract all fields from JSON in a single jq call |
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 | |
| set -x | |
| set -e | |
| # Add parallel execution logic | |
| MAX_JOBS=6 | |
| run_parallel() { | |
| # Check current job count and wait if the limit is reached |
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 python3 | |
| # | |
| # Sample Usage: | |
| # <command> '.*\.html' | |
| import logging | |
| import os | |
| import re | |
| from argparse import ArgumentParser |
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
| # Copyright (c) 2016-2021 Ming Qin (覃明) <https://github.com/QinMing> | |
| # Open source under MIT LICENSE. | |
| export PATH=/usr/local/bin:$PATH | |
| export ZSH="$HOME/.oh-my-zsh" | |
| # Make history-substring-search case sensitive, for history-substring-search plugin | |
| HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS="" | |
| DISABLE_MAGIC_FUNCTIONS=true |
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
| backup: | |
| docker stop mysql1 || true | |
| docker run --rm --volumes-from mysql1 -v $(BACK_DIR):/backup ubuntu tar cvf /backup/sql_volume.tar /var/lib/mysql | |
| docker start mysql1 | |
| restore: | |
| docker stop mysql1 | |
| docker run --rm --volumes-from mysql1 -v $(BACK_DIR):/backup ubuntu bash -c "rm -rf /var/lib/mysql/* && cd / && tar xvf /backup/sql_volume.tar" | |
| docker start mysql1 | |
| load: | |
| docker exec -i mysql1 mysql -uroot $(DATABASE_NAME) < mysqldump |
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
| docker run -it --rm --net=host -v $PWD/static:/data mnuessler/schemaspy -hq -t mysql \ | |
| -host YOUR-DB.COM \ | |
| -u USER \ | |
| -p 'PASSWORD' \ | |
| -db DB_NAME \ | |
| -o /data/FOLDER_NAME |
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 | |
| # To run this file itself: | |
| # wget https://gist.githubusercontent.com/QinMing/48cfe1e0a5b65d4c62dc2da8b91ab145/raw -O dotfile.sh && chmod +x dotfile.sh | |
| shell=bash | |
| # Print out message in color | |
| success() { | |
| echo -e "\033[1;32m$1\033[0m" |
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
| alias grep='grep --color=auto' | |
| alias l="ls -alhtr" | |
| alias g='git' | |
| alias gs="git status" | |
| alias gl="git l" | |
| alias gd="git diff" | |
| alias gb="git branch" | |
| alias gp="git pull" | |
| function parse_git_branch() { |
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
| du -hs * |
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
| eval "echo \"$(< $STARTUP_TPL_PATH)\"" > $STARTUP_PATH | |
| chmod +x $STARTUP_PATH |
NewerOlder