Skip to content

Commit eebe891

Browse files
committed
switch to go, pretty html + new ascii
1 parent 229af7f commit eebe891

File tree

16 files changed

+293
-2772
lines changed

16 files changed

+293
-2772
lines changed

.gitignore

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,61 @@
1-
node_modules
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/macos,go
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,go
4+
5+
### Go ###
6+
# If you prefer the allow list template instead of the deny list, see community template:
7+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
8+
#
9+
# Binaries for programs and plugins
10+
*.exe
11+
*.exe~
12+
*.dll
13+
*.so
14+
*.dylib
15+
16+
# Test binary, built with `go test -c`
17+
*.test
18+
19+
# Output of the go coverage tool, specifically when used with LiteIDE
20+
*.out
21+
22+
# Dependency directories (remove the comment below to include it)
23+
# vendor/
24+
25+
# Go workspace file
26+
go.work
27+
28+
### Go Patch ###
29+
/vendor/
30+
/Godeps/
31+
32+
### macOS ###
33+
# General
234
.DS_Store
35+
.AppleDouble
36+
.LSOverride
37+
38+
# Icon must end with two \r
39+
Icon
40+
41+
42+
# Thumbnails
43+
._*
44+
45+
# Files that might appear in the root of a volume
46+
.DocumentRevisions-V100
47+
.fseventsd
48+
.Spotlight-V100
49+
.TemporaryItems
50+
.Trashes
51+
.VolumeIcon.icns
52+
.com.apple.timemachine.donotpresent
53+
54+
# Directories potentially created on remote AFP share
55+
.AppleDB
56+
.AppleDesktop
57+
Network Trash Folder
58+
Temporary Items
59+
.apdisk
60+
61+
# End of https://www.toptal.com/developers/gitignore/api/macos,go

.prettierrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
FROM node
2-
WORKDIR /src
1+
FROM golang:1.17 as build
32

4-
# Separate copy to cache node modules
5-
COPY package*.json ./
6-
RUN npm i
3+
WORKDIR /build
74

8-
# Copy everything else over
9-
COPY . .
5+
COPY go.mod ./
6+
COPY go.sum ./
7+
RUN go mod download
8+
RUN go mod verify
109

11-
# Run!
12-
EXPOSE 3000
13-
ENV COFFEE_PORT=3000
14-
CMD ["npm", "start"]
10+
COPY main.go ./
11+
COPY frames/ ./frames/
12+
COPY static/ ./static/
13+
14+
RUN go build -a -ldflags='-extldflags=-static' -o 'tiny.coffee'
15+
16+
FROM gcr.io/distroless/base-debian11
17+
18+
COPY --from=build /build/tiny.coffee /
19+
20+
CMD [ "/tiny.coffee" ]

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
# tiny.coffee
22

3-
Fork of [`parrot.live`](https://github.com/hugomd/parrot.live),
4-
to allow any computer with `curl` to display an _animated_ cup of coffee.
3+
Fork of [`parrot.live`](https://github.com/hugomd/parrot.live), but with 100% less parrot and 100% more coffee. And now in go!
54

6-
## Try it!
7-
```bash
8-
curl -L tiny.coffee
5+
## Try it
6+
```console
7+
$ curl tiny.coffee
98
```
109

11-
## Contributors
12-
If someone can fix my horrible ascii art, pls contribute
10+
## ⚙️ Run it
11+
12+
Zero deps and only two env vars, `HOST` and `PORT`. Go wild.
13+
14+
### Go (>=1.16)
15+
16+
```console
17+
$ go build main.go
18+
```
19+
20+
### Container
21+
22+
```console
23+
$ podman run -p 8000:8000 ghcr.io/robherley/tiny.coffee
24+
```

docker-compose.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

frames/0.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
) ) (
2-
_______(_______
3-
/ ( ) \
4-
\_______________/
5-
| ╞═══╗
6-
| ╞═╗ ║
7-
| COFFEE | ║ ║
8-
| ╞═╝ ║
9-
| ╞═══╝
10-
\_____________/
1+
*
2+
.-~~*.
3+
,|`*__-'|
4+
|| |
5+
`| |
6+
`-__-'

frames/1.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
(
2-
___(_______)___
3-
/ ) ( \
4-
\_______________/
5-
| ╞═══╗
6-
| ╞═╗ ║
7-
| COFFEE | ║ ║
8-
| ╞═╝ ║
9-
| ╞═══╝
10-
\_____________/
1+
*
2+
.*~~-.
3+
,|`-__-'|
4+
|| |
5+
`| |
6+
`-__-'

frames/2.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
( )
2-
___)_______(___
3-
/ ) \
4-
\_______________/
5-
| ╞═══╗
6-
| ╞═╗ ║
7-
| COFFEE | ║ ║
8-
| ╞═╝ ║
9-
| ╞═══╝
10-
\_____________/
1+
*
2+
.-~~-.
3+
,|`-*_-'|
4+
|| |
5+
`| |
6+
`-__-'

frames/3.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
) (
2-
_______)_______
3-
/ ( \
4-
\_______________/
5-
| ╞═══╗
6-
| ╞═╗ ║
7-
| COFFEE | ║ ║
8-
| ╞═╝ ║
9-
| ╞═══╝
10-
\_____________/
1+
2+
.-*~-.
3+
,|`-__*'|
4+
|| |
5+
`| |
6+
`-__-'

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/robherley/tiny.coffee
2+
3+
go 1.17

0 commit comments

Comments
 (0)