Skip to content

Instantly share code, notes, and snippets.

@AshCoolman
Last active March 28, 2018 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshCoolman/2c7bafb260d10e13e6e547b116eb2627 to your computer and use it in GitHub Desktop.
Save AshCoolman/2c7bafb260d10e13e6e547b116eb2627 to your computer and use it in GitHub Desktop.
Snippets

Glob

python << EOF
import glob
for name in glob.glob('/*'):
  print(name)
EOF
python -c "$(echo -e "import glob\nfor name in glob.glob('/*'):\n print(name)")"

Build osx binary from go in ubuntu docker (approx)

git clone https://github.com/ichinaski/pxl.git .

echo <<< EOL
FROM golang:1.8

WORKDIR /go/src/app
COPY . .

RUN go get -d -v ./...
RUN go install -v ./...

CMD ["app"] 
EOL >> /etc/myconfig.conf;

docker build -t my-golang-app .



# ├── Dockerfile
# ├── LICENSE
# ├── README.md
# ├── color.go
# ├── color_test.go
# ├── image.go
# ├── image_test.go
# ├── logo.png
# ├── main.go
# ├── myapp
# └── src
#     └── github.com
#         ├── mattn
#         │   └── go-runewidth
#         │       └── ...
#         └── nsf
#             └── ....
docker run --rm -v "$PWD":/usr/src/myapp -v "$PWD"/src:/go/src/ -w /usr/src/myapp -e GOOS=darwin -e GOARCH=amd64 golang:1.8 go build -v

Get line number from stack

https://github.com/text-mask/text-mask/blob/master/common/testSetup.js#L15

OSX notify

https://apple.stackexchange.com/a/307492/71598

Design

Check quality of a JPG

identify -format '%Q' <path to jpg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment