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
| get_latest_release() { | |
| curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
| grep '"tag_name":' | # Get tag line | |
| sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
| } | |
| # Usage | |
| # $ get_latest_release "creationix/nvm" | |
| # v0.31.4 |
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> | |
| <head> | |
| <title> | |
| Spliced in Array Prototype To Return Original Array Reference | |
| </title> | |
| </head> | |
| <body> | |
| <h1> |
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 | |
| # save the file as <git_directory>/.git/hooks/pre-commit | |
| echo "Running Maven clean test for errors" | |
| # retrieving current working directory | |
| CWD=`pwd` | |
| MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| # go to main project dir | |
| cd $MAIN_DIR/../../ |
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 transpose(a) | |
| { | |
| return a[0].map(function (_, c) { return a.map(function (r) { return r[c]; }); }); | |
| // or in more modern dialect | |
| // return a[0].map((_, c) => a.map(r => r[c])); | |
| } |
NewerOlder