Skip to content

Instantly share code, notes, and snippets.

View ahndmal's full-sized avatar
😔
stand with my homeland Ukraine

Andrii Maliuta ahndmal

😔
stand with my homeland Ukraine
View GitHub Profile
package main
import (
"bytes"
"io/ioutil"
"log"
"net/http"
"time"
)
# GO
protoc -I src/ --go_out=src/ .\src\proto\messages.proto
# Java
protoc -I src/ --java_out=src/ .\src\proto\messages.proto
ScheduledExecutorService service = Executors.newScheduledThreadPool(3);
service.scheduleAtFixedRate(() -> {
System.out.println("hello");
}, 0L, 5L, TimeUnit.SECONDS);
package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
FROM gradle:7.2-jdk11 AS GR_BUILD
#WORKDIR app
COPY ./ ./
RUN gradle bootJar
FROM adoptopenjdk:11
COPY --from=GR_BUILD /home/gradle/build/libs/*.jar ./app.jar
CMD ["/bin/sh", "-c", "java -jar app*.jar"]
# syntax=docker/dockerfile:1
FROM golang:1.16-alpine
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"time"
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to my website!")
package main
import (
"encoding/json"
"net/http"
"path"
"strconv"
)
type Post struct {