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 -e | |
| # Text color variables | |
| txtund=$(tput sgr 0 1) # Underline | |
| txtbld=$(tput bold) # Bold | |
| txtred=$(tput setaf 1) # Red | |
| txtgrn=$(tput setaf 2) # Green | |
| txtylw=$(tput setaf 3) # Yellow | |
| txtblu=$(tput setaf 4) # Blue | |
| txtpur=$(tput setaf 5) # Purple |
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 -e | |
| # Text color variables | |
| txtund=$(tput sgr 0 1) # Underline | |
| txtbld=$(tput bold) # Bold | |
| txtred=$(tput setaf 1) # Red | |
| txtgrn=$(tput setaf 2) # Green | |
| txtylw=$(tput setaf 3) # Yellow | |
| txtblu=$(tput setaf 4) # Blue | |
| txtpur=$(tput setaf 5) # Purple |
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 | |
| # | |
| # Automatically adds branch name every commit message. | |
| # | |
| NAME=$(git branch | grep '*' | sed 's/* //') | |
| TEXT=$(cat "$1" | sed '/^#.*/d') | |
| if [ -n "$TEXT" ] | |
| then | |
| echo "[$NAME]"' '$(cat "$1" | sed '/^#.*/d') > "$1" |
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
| export OI_TOKEN=<your orchestrate token here> | |
| curl https://api.orchestrate.io/v0/movies/1 \ | |
| -X PUT \ | |
| -i \ | |
| -H 'Content-Type:application/json' \ | |
| -u "$OI_TOKEN:" \ | |
| -d '{"title": "Tremors","released": "1990","description": "Natives of a small isolated town defend themselves against strange underground creatures which are killing them one by one.", "genres": ["comedy","horror","sci-fi"],"actors": ["Kevin Bacon","Fred Ward","Finn Carter"]}' | |
| curl https://api.orchestrate.io/v0/movies/2 \ |
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
| export OI_TOKEN=<your orchestrate token here> | |
| curl https://api.orchestrate.io/v0/movies/1 \ | |
| -X PUT \ | |
| -i \ | |
| -H 'Content-Type:application/json' \ | |
| -u "$OI_TOKEN:" \ | |
| -d '{"title": "Tremors","released": "1990","description": "Natives of a small isolated town defend themselves against strange underground creatures which are killing them one by one.", "genres": ["comedy","horror","sci-fi"]}' | |
| curl https://api.orchestrate.io/v0/movies/2 \ |
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
| export OI_TOKEN=<your orchestrate token here> | |
| curl https://api.orchestrate.io/v0/actors/1 \ | |
| -X PUT \ | |
| -i \ | |
| -H 'Content-Type:application/json' \ | |
| -u "$OI_TOKEN:" \ | |
| -d '{"name": "Kevin Bacon"}' | |
| curl https://api.orchestrate.io/v0/actors/2 \ |
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
| curl -i "https://api.orchestrate.io/v0/movies/1/relation/actor/actors/1" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/1/relation/actor/actors/2" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/1/relation/actor/actors/3" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/2/relation/actor/actors/1" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/2/relation/actor/actors/4" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/2/relation/actor/actors/5" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/3/relation/actor/actors/1" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/3/relation/actor/actors/6" -u "$OI_TOKEN:" -X PUT | |
| curl -i "https://api.orchestrate.io/v0/movies/3/relation/actor/actors/7" -u "$OI_TOKEN:" -X PUT |
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
| func main() { | |
| r := httprouter.New() | |
| // Health check | |
| r.GET(“/health”, HealthCheckHandler) | |
| // Authentication | |
| r.POST(“/token-auth”, HeaderMiddleware(TokenAuthHandler)) | |
| r.POST(“/p”, HeaderMiddleware(SomeFormHandler)) | |
| fmt.Println(“Starting server on :3030”) | |
| http.ListenAndServe(“:3030”, r) | |
| } |
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
| func main() { | |
| r := httprouter.New() | |
| // Health check | |
| r.GET(“/health”, HealthCheckHandler) | |
| // Authentication | |
| r.POST(“/token-auth”, TokenAuthHandler) | |
| r.POST(“/p”, AuthMiddleware(SomeFormHandler)) | |
| fmt.Println(“Starting server on :3030”) | |
| http.ListenAndServe(“:3030”, &Server{r}) | |
| } |
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
| func (s *Server) ServeHTTP (w http.ResponseWriter, r *http.Request) { | |
| w.Header().Set(“Access-Control-Allow-Origin”, “*”) | |
| w.Header().Set(“Access-Control-Allow-Headers”, “Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization”) | |
| s.r.ServeHTTP(w, r) | |
| } |
OlderNewer