Skip to content

Instantly share code, notes, and snippets.

Avatar
⛱️

João Vilaça vilaca

⛱️
View GitHub Profile
View prometheus.txt
prometheus, version 2.28.1 (branch: non-git, revision: non-git)
build user: brew@iMac-Pro
build date: 20210701-23:57:57
go version: go1.16.5
platform: darwin/amd64
usage: prometheus [<flags>]
The Prometheus monitoring server
@vilaca
vilaca / docker-compose.yaml
Created Aug 3, 2021
AlertManager cluster (3x)
View docker-compose.yaml
---
version: "3.1"
services:
am-01:
command:
- '--cluster.listen-address=0.0.0.0:9094'
- '--cluster.peer=am-02:9094'
- '--config.file=/etc/alertmanager/config.yaml'
- '--log.level=error'
- '--storage.path=/alertmanager'
@vilaca
vilaca / docker-compose.yaml
Last active Jul 28, 2021
VictoriaMetrics w/ lx sensor data
View docker-compose.yaml
---
version: "3.1"
services:
grafana:
depends_on:
- victoriametrics
image: "grafana/grafana:8.0.5"
ports:
- "80:3000"
restart: always
@vilaca
vilaca / gist:6659438
Created Sep 22, 2013
Lista de concelhos Portugueses por ordem alfabética
View gist:6659438
Abrantes
Águeda
Aguiar da Beira
Alandroal
Albergaria-a-Velha
Albufeira
Alcácer do Sal
Alcanena
Alcobaça
Alcochete
@vilaca
vilaca / AbstractResultSet.java
Created Jul 23, 2016
Wrapper for java.sql.ResultSet. All methods throw UnsupportedOperationException.
View AbstractResultSet.java
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.NClob;
View mongodb-rest.go
package main
// to run:
// launch mongodb container: docker run -p 27017:27017 --name local-dev-mongodb -d mongo:latest
// start service: go run main.go
import (
"context"
"log"
"net/http"
View gist:1d07fa7ba9afcfe5ad74
#ifndef ILI9341_H_
#define ILI9341_H_
#include <msp430.h>
#define RES BIT0 // P1.0
#define SCLK BIT5 // P1.5
#define CS BIT4 // P1.4
#define DC BIT6 // P1.6
#define SDIN BIT7 // P1.7
View shorten.py
from bidict import bidict
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from flask import Flask, request, redirect
from flask_restful import Resource, Api
from random import randrange
class Redirects(Resource):
def get(self, short):
View java-style-eclipse.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="GoogleStyle adaptation by jvilaca@gmail.com" version="1.0.0">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@vilaca
vilaca / index.html
Created Sep 26, 2019
Google maps full background
View index.html
<html>
<head>
<style>
#map_canvas {
width: 100%;
height: 100vh;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>