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
# xurls: https://github.com/mvdan/xurls | |
s=0 | |
for url in `find . -name "*" -type f | xargs xurls | grep -v "ldap.*"`; do | |
if ! `curl -LI $url -o /dev/null --fail -s`; then | |
echo $url | |
s=1 | |
fi | |
done | |
if [ $s -ne 0 ]; then | |
exit 1 |
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
s=0 | |
for url in `find ./test -name "*" -type f | xargs xurls | grep -v "ldap.*"`; do | |
if ! `curl -LI $url -o /dev/null --fail -s`; then | |
echo $url | |
s=1 | |
fi | |
done | |
if [ $s -ne 0 ]; then | |
exit 1 | |
fi |
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
// https://play.golang.org/p/jUzWcBiO4xJ | |
// Output: | |
// B 0 | |
// A 0 | |
// end | |
package main | |
import ( | |
"fmt" |
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
// https://play.golang.org/p/2LBJbIBVw37 | |
package main | |
import ( | |
"fmt" | |
) | |
type Foo struct { | |
name string | |
} |
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
package main | |
import ( | |
"fmt" | |
"github.com/google/go-cmp/cmp" | |
"github.com/google/go-cmp/cmp/cmpopts" | |
) | |
func main() { |
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
package users | |
import ( | |
"encoding/json" | |
) | |
// UserProfile contains all the information details of a given user | |
type UserProfile struct { | |
FirstName string `json:"first_name"` | |
LastName string `json:"last_name"` |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"reflect" | |
"github.com/mitchellh/mapstructure" | |
"github.com/suzuki-shunsuke/go-set" | |
) |
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
{ | |
"permissions" : { | |
"outputs" : [ "create", "edit", "terminate", "read" ], | |
"sources" : [ "read" ], | |
"indexranges" : [ "read", "rebuild" ], | |
"deflector" : [ "read", "cycle" ], | |
"loggers" : [ "readsubsystem", "edit", "editsubsystem", "read" ], | |
"inputs" : [ "terminate", "read", "create", "changestate", "edit" ], | |
"lbstatus" : [ "change" ], | |
"roles" : [ "edit", "create", "read", "delete" ], |
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
--- | |
- hosts: localhost | |
tasks: | |
- shell: "echo '{\"changed\": true}'" | |
register: result | |
changed_when: (result.stdout|from_json)["changed"] | |
- shell: "echo '{\"changed\": false}'" | |
register: result | |
changed_when: (result.stdout|from_json)["changed"] |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"github.com/ghodss/yaml" | |
) |