Skip to content

Instantly share code, notes, and snippets.

View phrozen's full-sized avatar

Guillermo Estrada phrozen

View GitHub Profile
@phrozen
phrozen / main.go
Created December 11, 2023 21:07
Advent of Code 2023 - Day 7
package main
import (
"advent/utils"
"fmt"
"math"
"sort"
"strconv"
"strings"
)
@phrozen
phrozen / main.go
Created December 11, 2023 02:54
Advent of Code 2023 - Day 4
package main
import (
"fmt"
"math"
"os"
"regexp"
"slices"
"strings"
)
package main
import (
"encoding/json"
"fmt"
"math/rand"
"net/http"
"strings"
"time"
@phrozen
phrozen / Dockerfile
Created February 22, 2021 21:56
Golang Dockerfile template for binary only images
# 1. Build a statically linked binary
FROM golang:alpine as builder
# Install git to install dependencies (skip if vendored)
RUN apk add --update --no-cache git
# Copy source code to working directory
COPY . /src
WORKDIR /src
# Add some env vars for the build process
ENV CGO_ENABLED=0
ENV GOOS=linux
@phrozen
phrozen / docker-compose.yml
Created August 15, 2019 15:40
InfluxData TICK stack (InfluxDB + Telegraf + Kapacitor + Chronograf + CLI)
version: '3'
services:
# Define an InfluxDB service
influxdb:
image: influxdb:latest
volumes:
# Mount for influxdb data directory
- ./data/influxdb:/var/lib/influxdb
# Mount for influxdb configuration
@phrozen
phrozen / docker-compose.yml
Created August 14, 2019 20:25
Go App + InfluxDB + Telegraf + Graphana
# start: docker-compose up
# tear down: docker-compose down
version: '3'
services:
server:
build:
context: .
ports:
- "8010:8010"
influxdb:
# scene.txt
# image_size: width height (default 320x240)
image_size 640 640
# trace depth: int (default 3)
depth 5
# oversampling: int (default 1 = no oversampling)
oversampling 2
# Proyecto 2
# Ray Tracer Avanzado
# Guillermo Estrada
# Rene Garcia
# Edgar López
# Luis Ledezma
# Daniel Castillo
#
# Constantes utilizadas dentro del programa
MAX_DISTANCE = 9999999999
# Proyecto 1
# Ray tracer básico
# Guillermo Estrada
# Rene Garcia
# Edgar López
# Luis Ledezma
# Daniel Castillo
#
# Constantes utilizadas dentro del programa
MAX_DISTANCE = 9999999999
@phrozen
phrozen / main.go
Last active December 25, 2016 18:00
STL reader
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"github.com/spf13/nitro"
"io"