Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| package main | |
| import ( | |
| "encoding/csv" | |
| "log" | |
| "os" | |
| ) | |
| func main() { | |
| txtfile, err := os.Open("data.txt") |
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 | |
| cat << EOF | | |
| [{ | |
| "name": "A water bottle", | |
| "sku": "wrt1" | |
| },{ | |
| "name": "Water bottles", | |
| "sku": "wrt6" | |
| } | |
| ] |
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
| [hendry@t14s aws-sam-gateway-example]$ go build -o go-serverless-api ./cmd/go-serverless-api | |
| # github.com/kaihendry/aws-sam-gateway-example/cmd/go-serverless-api | |
| cmd/go-serverless-api/main.go:17:53: undefined: HealthHandler | |
| [hendry@t14s aws-sam-gateway-example]$ grep HealthHandler *.go | |
| // HealthHandler is an endpoint for healthchecks | |
| func HealthHandler(w http.ResponseWriter, r *http.Request) { | |
| [hendry@t14s aws-sam-gateway-example]$ grep package *.go | |
| package goserverlessapi | |
| [hendry@t14s aws-sam-gateway-example]$ grep package ./cmd/go-serverless-api/*.go | |
| package goserverlessapi |
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
| <div id="root"></div> | |
| <script src="https://unpkg.com/react@16/umd/react.production.min.js" crossorigin></script> | |
| <script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js" crossorigin></script> | |
| <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
| <script type="jsx" src="main.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 | |
| cache=~/.cache/sloc2 | |
| count() { | |
| echo Arg "$@" >&2 | |
| if ! test -d "$1" | |
| then | |
| echo $1 not a dir >&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
| #!/bin/bash -e | |
| cache=~/.cache/sloc | |
| count () { | |
| local in | |
| read -r in | |
| set -- "$in" | |
| fullpath=$(readlink -f "${1:-.}") | |
| echo Full path: "$fullpath" |
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
| foo () { | |
| set -- < /dev/stdin | |
| echo Arghs $0 $1 | |
| } | |
| printf "one\ntwo\nthree" | dmenu | foo |
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 | |
| count () { | |
| test -d "$1" || cd "$1" | |
| for i in * | |
| do | |
| dirsep=$(test -d $i && echo /) | |
| echo ${i}${dirsep} $(find $i -type f -exec cat {} + | wc -l) | |
| done | dmenu -l 10 | count | |
| } |
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
| [hendry@t480s src]$ find firefox-78.0.1 -type f -exec wc -l {} \; | awk '{ SUM += $1} END { print SUM }' | |
| 43627834 | |
| [hendry@t480s src]$ find firefox-78.0.1 -type f -exec wc -l {} + | awk '{ SUM += $1} END { print SUM }' | |
| 87255668 |