- Generate Git authors file
- Create Git repository
- Handling irregular branch structures
- Create local branches from remotes/svn/*
- Create clean Git remote and populate
- Other useful links
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 | |
| if [[ `id -u` != 0 ]]; then | |
| echo "Must be root to run script" | |
| exit | |
| fi | |
| read -p "Enter user name and press [ENTER]: " UserName | |
| if [[ $UserName == `dscl . -list /Users UniqueID | awk '{print $1}' | grep -w $UserName` ]]; then |
These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.
Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.
- JSON-HAL specification: http://stateless.co/hal_specification.html#media_type_identifiers
- JSON linking with HAL: http://blog.stateless.co/post/13296666138/json-linking-with-hal
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
| # sh get_token.sh user pass | |
| curl -s -d '{"scopes":["repo"],"note":"admin script"}' -u "$1:$2" -XPOST https://api.github.com/authorizations | grep token |