Skip to content

Instantly share code, notes, and snippets.

🇳🇱
based in amsterdam

Herlon Aguiar herlon214

🇳🇱
based in amsterdam
Block or report user

Report or block herlon214

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@herlon214
herlon214 / fibo.go
Created Jul 20, 2019
GoLang Fibonacci with cache
View fibo.go
package pkg
import (
"math/big"
)
var cache = make(map[int]*big.Int, 0)
// Fibo calc
func Fibo(n int) *big.Int {
View identicon.ex
defmodule Identicon do
def main(input) do
input
|> create_image_from_input
|> pick_color
|> build_grid
|> filter_odd_squares
|> build_pixel_map
|> draw_image
@herlon214
herlon214 / init
Created Jan 18, 2019
Bash to work with gdsm
View init
#!/bin/bash
export $(curl http://169.254.169.254/latest/user-data)
docker swarm leave
docker swarm join --token TOKEN GDSM_IP:2377
NODE=$(docker info --format '{{ .Swarm.NodeID}}')
curl http://GDSM_IP:3300/label -X POST -d $(printf '{"ServiceName":"%s","NodeID":"%s"}' $SERVICE $NODE) -H "Content-Type: application/json"
@herlon214
herlon214 / init.service
Created Jan 18, 2019
Service starts after docker
View init.service
[Unit]
Description=Initialize docker
After=docker.service
Requires=docker.service
BindsTo=docker.service
[Service]
ExecStart=/bin/bash /home/core/init
ExecReload=/bin/bash /home/core/init
ExecStop=/bin/bash /home/core/init
@herlon214
herlon214 / Dockerfile
Created Dec 7, 2018
Compile and build NodeJS
View Dockerfile
# Build
FROM node:8.10.0 as builder
ENV NODE_ENV development
WORKDIR /app
COPY [".", "./"]
RUN yarn install --production=false && yarn compile
# Run
FROM node:8.10.0
View jest_with_parcel.txt
// babel.rc
{
"presets": [
"es2015"
]
}
// package.json
{
"dependencies": {
View FilterBranchName.sh
echo 'feature/testingGDSC' | sed -e 's/\//-/g'
@herlon214
herlon214 / Go build with docker
Created May 19, 2018
Build a go project within a Docker container
View Go build with docker
docker run --rm -v ${PWD}:/go/src/github.com/herlon214/gdsc -w /go/src/github.com/herlon214/gdsc/cmd/gdsc golang:latest /bin/bash -c "go get -v && go build -v -o /go/src/github.com/herlon214/gdsc/dist"
View NPM fix docker permissions.md

Fix npm docker permissions

Add this line into your Dockerfile

RUN npm config set unsafe-perm=true

@herlon214
herlon214 / Dockerfile
Created Mar 29, 2018 — forked from nknapp/Dockerfile
Traefik setup as reverse-proxy with docker and letsencrypt
View Dockerfile
FROM traefik:camembert
ADD traefik.toml .
EXPOSE 80
EXPOSE 8080
EXPOSE 443
You can’t perform that action at this time.