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/sh | |
| # Move the current working tree into a subfolder. | |
| # | |
| # This will rewite all branches and tags, so this should not | |
| # be performed on a repo that has been shared with others, because it | |
| # will force them to reset their history. | |
| # | |
| # Use at your own risk. | |
| # | |
| # Put the script in your path and invoke it this way: |
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
| # execute on the prompt or define it as a shell function | |
| for i in `cat .env`; do | |
| export $i | |
| done |
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
| # execute on the prompt or define it as a shell function | |
| for i in `cat .env`; do | |
| unset `echo $i | cut -f 1 -d "="` | |
| done |
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
| find . -type f -name '*.*' | sed 's|.*\.||' | sort -u |
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
| find . -print | grep -i '.*[.]xml' |
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
| for i in `ls *.mkv`; do [[ $i =~ [sS]([0-9]{2})[eE]([0-9]{2}) ]] && mv *${BASH_REMATCH[1]}x${BASH_REMATCH[2]}*.srt ${i%????}.srt 2> /dev/null; done |
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
| # see: https://askubuntu.com/questions/62095/how-to-alias-git-to-g-so-that-bash-completion-rules-are-preserved/62098#62098 | |
| git_alias_complete() | |
| { | |
| alias='g' | |
| complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \ | |
| || complete -o default -o nospace -F _git $alias | |
| } |
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
| class OCR | |
| OCR_MAP = { | |
| " _ | ||_|" => 0, | |
| " | |" => 1, | |
| " _ _||_ " => 2, | |
| " _ _| _|" => 3, | |
| " |_| |" => 4, | |
| " _ |_ _|" => 5, | |
| " _ |_ |_|" => 6, | |
| " _ | |" => 7, |
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
| require 'dotenv' | |
| require 'uri' | |
| require 'mongo' | |
| require 'active_support/inflector' | |
| Dotenv.load | |
| def format_uri(uri) | |
| index = (uri =~ /@/) | |
| index = (uri =~ /\/{2}/) + 1 unless index |
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
| require 'dotenv' | |
| require 'uri' | |
| require 'mongo' | |
| Dotenv.load | |
| def format_uri(uri) | |
| index = (uri =~ /@/) | |
| index = (uri =~ /\/{2}/) + 1 unless index | |
| uri[index+1..-1] |