Skip to content

Instantly share code, notes, and snippets.

View evbruno's full-sized avatar

Eduardo V. Bruno evbruno

View GitHub Profile
@evbruno
evbruno / dumb.md
Last active May 24, 2022 21:07
skelleton JS with fauna

shell

mkdir dumb-project && cd dumb-project
npm init -y
yarn add faunadb
docker run -p 8443:8443 fauna/faunadb

index.js

@evbruno
evbruno / Dockerfile
Created April 21, 2022 12:37
docker build / buildkit
FROM node:lts
WORKDIR /app
RUN echo "const express = require('express')" > index.js
RUN echo "const app = express()" >> index.js
RUN echo "app.get('/', function (req, res) {" >> index.js
RUN echo "res.send('Hello World')" >> index.js
RUN echo "})" >> index.js
RUN echo "app.listen(3000)" >> index.js
@evbruno
evbruno / faunadb-dotnet.md
Last active May 4, 2020 19:58
faunadb csharp hello world

FaunaDB csharp dotnet sample Solution

Create new Console App

$ dotnet new console -o faunadb-app -f netcoreapp3.1

The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on faunadb-app/faunadb-app.csproj...
@evbruno
evbruno / JenkinsBuilds.groovy
Created April 21, 2020 21:04
Delete Jenkins builds
def subject = "job name"
Jenkins.instance.getAllItems(Job.class).each { job ->
if (job.toString().contains(subject)) {
println " > " + job.name
job.builds.each { build ->
println ' >> ' + build.number + ' > ' + build.result + ' > ' + build.getDescription()
//
//if (build.number < 100) build.delete()
//if (Result.SUCCESS != build.result) build.delete()
@evbruno
evbruno / fiis.sh
Created March 12, 2020 13:41
Pegar nome do Administrador do FII
#!/bin/bash
TICKERS=('alzr11' 'vrta11' 'knri11')
for t in "${TICKERS[@]}"
do
echo -n "$t "
curl --silent https://statusinvest.com.br/fundos-imobiliarios/$t | \
grep '^<strong class="fw-700">' | sed 's/<strong class="fw-700">//g' | sed 's/<\/strong>//g'
done
@evbruno
evbruno / proxy.go
Created February 26, 2020 13:32
Go Proxy Go
// eg: go run proxy.go -url http://localhost:8443
package main
import (
"fmt"
"log"
"flag"
//"bytes"
//"io/ioutil"
"net/http"
@evbruno
evbruno / FaunaHelloWorld.cs
Created February 25, 2020 21:11
Fauna Hello World
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using FaunaDB.Client;
using FaunaDB.Types;
using FaunaDB.Query;
using static FaunaDB.Query.Language;
namespace FaunaTest
{
@evbruno
evbruno / fql.scala
Last active September 30, 2019 23:12
FQL to JSON
/*
// build.sbt
scalaVersion := "2.11.8"
libraryDependencies ++= Seq("com.faunadb" %% "faunadb-scala" % "2.8.1")
*/
import com.fasterxml.jackson.databind.{ObjectMapper, SerializationFeature}
import faunadb.{query => q}
object FQLToJson extends App {
@evbruno
evbruno / README.md
Last active May 22, 2019 17:09
GCE + docker + minikube + kubectl

Create a GCE Image with VM enabled

source: https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances

$ gcloud compute disks create ubuntu-vm-disk --image-project ubuntu-os-cloud --image-family ubuntu-1604-lts --zone us-central1-a

$ gcloud compute images create ubuntu-nested-vm-image \
  --source-disk ubuntu-vm-disk --source-disk-zone us-central1-a \
 --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
@evbruno
evbruno / CalculadoraFinanciamentoSAC.scala
Last active July 6, 2018 16:59
CalculadoraFinanciamentoSAC
case class DadosFinanciamento(valorFinanciado: Double,
amortizacao: Double,
parcelas: Int,
jurosMensal: Double)
case class ParcelaCalculada(numDaParcela: Int,
valor: Double,
jurosSobreSaldo: Double,
saldoDevedor: Double) {