Skip to content

Instantly share code, notes, and snippets.

View juacompe's full-sized avatar

juacompe juacompe

View GitHub Profile
@juacompe
juacompe / docker-compose for node
Created May 3, 2019 06:34
using docker-compose instead of `docker run` with long parameter list
version: '2'
services:
base:
image: node:11
volumes:
- .:/usr/src/service/
working_dir: /usr/src/service/
install:
extends:
service: base
Dockerfile
.dockerignore
.git/
FROM maven:slim
# copy pom file
COPY ./pom.xml ./
# download all dependency libraries
RUN mvn dependency:go-offline -B
# copy the rest of the code
COPY ./ ./
# build package
RUN mvn install
CMD mvn spring-boot:run
FROM maven:slim as build-stage
COPY ./ ./
RUN mvn install
CMD mvn spring-boot:run
@juacompe
juacompe / main.go
Last active December 10, 2018 12:26
https with keep-alives history
package main
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httputil"
)
func main() {
url := "https://jsonplaceholder.typicode.com/posts/1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cache-control", "no-cache")
for i := 0; i < 2; i++ {
tr := &http.Transport{}

Keybase proof

I hereby claim:

  • I am juacompe on github.
  • I am juacompe (https://keybase.io/juacompe) on keybase.
  • I have a public key ASC6VsOfu8Vi_pGtqojsYuhppu9jPXD-4v0BLPnw5wFHrwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am juacompe on github.
  • I am juacompe (https://keybase.io/juacompe) on keybase.
  • I have a public key ASC6VsOfu8Vi_pGtqojsYuhppu9jPXD-4v0BLPnw5wFHrwo

To claim this, I am signing this object: