Last active
September 3, 2015 07:57
-
-
Save ds0nt/e9cb82f2904c60346b53 to your computer and use it in GitHub Desktop.
Awesome bash hacks --- (for web devs & ninjas, for dot-file pride, for pleasing the monospace gods )
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
#### #### #### #### #### #### | |
# / ! / | |
# / e / | |
# / M / | |
# / / | |
# / k / | |
# / r / | |
# / o / | |
# F / | |
# / | |
# / | |
# | |
# js friendly tree | |
src-tree() | |
{ | |
tree -I node_modules | |
} | |
# destroy all docker containers.. | |
docker-purge() | |
{ | |
docker ps -aq | while read x; do docker stop $x; docker rm $x; done | |
} | |
# customized bashrc per project -- for project-related aliases and tasks! | |
# for instance: https://github.com/kloudsio/klouds/blob/master/.bashrc-klouds | |
foo-bash() | |
{ | |
bash --rcfile /code/foo/.bashrc-foo | |
} | |
# | |
# Let's start a collection. :) | |
# |
xclip + shell scripts + keybound = clipboard hacks
# ouputs your clipboard contents
xclip -o
# github clone hotkey
REPO=`xclip -o`
SLUG=`echo $REPO | cut -d/ -f 4-`
git clone $REPO /github/`xclip -o | cut -f -2`
# scrape urls from a page? <or maybe / emails / color scheme>
curl "`xclip -o`" | grep -E -o 'href="http[^"]*' | cut -c 7-
# https://gist.github.com/fluidicon.png
# https://assets-cdn.github.com/
# https://assets-cdn.github.com/pinned-octocat.svg
# https://assets-cdn.github.com/favicon.ico
# ....
# Imagine the possibilities!
# gist, dropbox, codepen, add trello cards.. call apis.. copy to editor.. eval things in containers.. save things in dbs, email to self, paste as cron job, relabel your partition. ? :O
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Employing use of a customized .bashrc tailored for a particular project has been rather fun.
Alias or keybind project-related scripts, tasks, deploys, ssh & workflow stuff (especially in front-end dev -- oh god)
$ klouds-bash
opens bash with a customized .bashrc that increases keystroke potency!Example Output