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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Canvas clock</title> | |
| <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> | |
| <link rel="stylesheet" href="css/app.css"> | |
| <script src="bower_components/jquery/dist/jquery.js"></script> | |
| <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> | |
| <script src="js/app.js"></script> |
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 | |
| function show_usage { | |
| cat <<- _EOF_ | |
| Search Bash History using Grep and Percol | |
| Examples: | |
| $ h ssh | |
| $ h 'ssh user@' |
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
| ## declare an array variable | |
| declare -a arr=("element1" "element2" "element3") | |
| ## now loop through the above array | |
| for i in "${arr[@]}"; do | |
| echo "$i" | |
| # or do whatever with individual element of the array | |
| done | |
| # You can access them using echo "${arr[0]}", "${arr[1]}" also |
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 | |
| TITLE="Mail Title" | |
| CONTENT="Mail Content" | |
| cat <<EOF | mutt -s "${TITLE}" -e 'set content_type="text/html"' -- 527072230@qq.com | |
| <html> | |
| <body> | |
| <h1>${TITLE}</h1> | |
| <p>${CONTENT}</p> |
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
| $('#navcontainer').find('a[href="' + location.pathname + '"]').parents('li').addClass('active'); |
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 | |
| #: Title : open_doc.sh | |
| #: Usage : open_doc.sh workflow | |
| #: Synopsis : a tool for quick open doc | |
| #: Date : 2015-02-13 11:23:04 | |
| #: Author : shulei | |
| #: version : 1.0 | |
| #: Description : use xdotool to quick swith to a project relative url | |
| #: Required : target => which target | |
| #: Options : -i |
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
| :<<!EOF! | |
| !EOF! |
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
| function retry { | |
| local retry_max=$1 | |
| shift | |
| local count=$retry_max | |
| while [ $count -gt 0 ]; do | |
| "$@" && break | |
| count=$(($count - 1)) | |
| sleep 1 | |
| 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
| for i in 1 2 3 4 5; do command && break || sleep 15; done |