Skip to content

Instantly share code, notes, and snippets.

View donvito's full-sized avatar
🚀
solo dev building apps with AI. launched aidreamphoto.com

Melvin Vivas @DonvitoCodes donvito

🚀
solo dev building apps with AI. launched aidreamphoto.com
View GitHub Profile
@donvito
donvito / Dockerfile
Last active November 2, 2019 05:35
Dockerfile to build a docker image with a main.go gist
FROM golang:1.13.4 AS builder
ARG GIST_RAW_URL
RUN mkdir /app
RUN curl $GIST_RAW_URL --output /app/main.go
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build -o main ./...
FROM alpine:latest AS production
COPY --from=builder /app .
CMD ["./main"]
@donvito
donvito / main.go
Last active September 26, 2019 12:36
package main
import "fmt"
func main() {
fmt.Println("Hello universe! gist!")
}
@donvito
donvito / data.json
Last active September 18, 2019 04:27
GraphQL Go
[
{
"id": 1,
"position": "Software Engineer",
"company": "Apple",
"description": "job description",
"skillsRequired": ["Go", "GraphQL"],
"location": "location",
"employmentType": "full-time"
},
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@donvito
donvito / resize.py
Created August 13, 2019 04:28
Python script to resize photos
import os, sys
from PIL import Image
size = 512, 512
resizedFolder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "resized")
if not os.path.exists(resizedFolder):
os.makedirs(resizedFolder)
for file in os.listdir("./"):
if file.endswith(".jpg") or file.endswith(".jpeg") or file.endswith(".png") :
package main
import (
"fmt"
)
func main() {
x := 10
fmt.Println(sum_i(x))
@donvito
donvito / index.html
Created November 10, 2018 06:46
Vue.js code to query github API
<html>
<head>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
<github-repo-list
v-for="repo in repos"
v-bind:repo="repo"
v-bind:key="repo.name"
@donvito
donvito / main.go
Created October 7, 2018 12:37
base64 encoder
package main
import (
"encoding/base64"
"fmt"
)
func main() {
msg := "melvin:melvin"
encoded := base64.StdEncoding.EncodeToString([]byte(msg))
@donvito
donvito / main.go
Created October 7, 2018 07:35
Go Modules sample client to use v2.0.0 of hellomod module
package main
import (
"github.com/donvito/hellomod/v2"
)
func main() {
hellomod.SayHello("Melvin")
}
@donvito
donvito / main.go
Created October 7, 2018 07:33
Go modules sample client which uses latest version of hellomod module
package main
import (
"github.com/donvito/hellomod"
)
func main() {
hellomod.SayHello()
}