This file contains 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
I've wrapped your code in a plugin. Hope it's useful. | |
Usage: | |
In your HTML, an element that you want to act as footer (ex. #footer), an element to act as trigger (ex. #trigger) are assumed. | |
apart from this html file, you'll need to include my snippet somehow, and also bind it to your footer element. | |
Here is an example illustrating the interdependent code bits: | |
This file contains 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
# found here: | |
# http://stackoverflow.com/questions/1305237/how-to-list-variables-declared-in-script-in-bash/1305273#1305273 | |
# # Todo | |
# - instead of echoing all vars out on one line separated by spaces, find a way to separate them, so they are one line each | |
# can be run in command line | |
( VARS="`set -o posix ; set`"; source repos/backup/test/conf/sync.conf; SCRIPT_VARS="`grep -vFe "$VARS" <<<"$(set -o posix ; set)" | grep -v ^VARS=`"; unset VARS; echo $SCRIPT_VARS; unset SCRIPT_VARS ) |
This file contains 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
# ================ | |
# = Colorised ls = | |
# ================ | |
# color-ls is now part of the standard ls command. To get colorized directory listings, simply issue the command (in bash): | |
alias ls='ls --color=tty' |
This file contains 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
# List apache2 virtualhosts | |
# Lists virtualhosts currently enabled for apache2, | |
# showing the ServerName:port, conf file and DocumentRoot | |
/usr/sbin/apache2ctl -S 2>&1 | perl -ne 'm@.*port\s+([0-9]+)\s+\w+\s+(\S+)\s+\((.+):.*@ && do { print "$2:$1\n\t$3\n"; $root = qx{grep DocumentRoot $3}; $root =~ s/^\s+//; print "\t$root\n" };' |
This file contains 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
# read two files and insert their lines in a bash command | |
# http://www.linuxquestions.org/questions/programming-9/help-with-bash-script-rename-multiple-files-347062/ | |
# | |
# usage example: | |
# | |
# $ do2lists filelist_originalnames.txt filelist_newnames.txt | bash | |
ARGV[1] == FILENAME{ | |
getline out2 < ARGV[2] |
This file contains 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
# http://stackoverflow.com/questions/1670970/how-to-cherry-pick-multiple-commits | |
# 1. checkout the branch you want to cherry-pick to | |
# 2. in bash do: | |
git rev-list --reverse [first sha1 hash in range]..[last sha1 hash in range] | xargs -n 1 git cherry-pick |
This file contains 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
# zip a git repo root folder while ignoring git files and copying it somewhere | |
cd my_git_repo | |
git archive HEAD --format=zip --output=somewhere/in/the/fie/system/my_zipped_git_repo.zip |
This file contains 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
# Adding files to .gitignore that are already tracked does not work. (and it’s actually pretty well documented). Instead, it’s possible to use this command: | |
git update-index --assume-unchanged [filename(s)] |
This file contains 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
# Linux | |
eval `ssh-agent` | |
ssh-add ~/.ssh/some_key_rsa | |
ssh user@server | |
# Mac | |
## As of the Leopard release of OS X, ssh-agent is more tightly integrated with Keychain. It is possible to store the passphrases of all of your SSH keys securely in Keychain, from which ssh-agent will read them on startup. The bottom line is that it is simple to secure your keys with passphrases, but never have to type the passphrase to use them! Here is how: | |
## Add the pass phrase to each ssh key to keychain: |
This file contains 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
# Ref.: http://stackoverflow.com/a/359759/173679 | |
git remote rm origin | |
git tag -l | xargs git tag -d | |
git filter-branch --tag-name-filter cat --prune-empty --subdirectory-filter ABC HEAD | |
git reset --hard | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d | |
git reflog expire --expire=now --all | |
git gc --aggressive --prune=now |
OlderNewer