Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
juanpabloaj / boxplot_duration_per_project.py
Last active Jan 28, 2021
gitlab_runner_jobs_duration
View boxplot_duration_per_project.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib
sns.set(rc={'figure.figsize':(14,12)})
file_name = "duration_per_project.csv"
df = pd.read_csv(file_name, ';')
View batetry_level.ino
#include <M5StickCPlus.h>
// the setup routine runs once when M5StickC starts up
void setup() {
// initialize the M5StickC object
M5.begin();
// Lcd display
M5.Lcd.fillScreen(WHITE);
@juanpabloaj
juanpabloaj / main.go
Created Dec 22, 2020
JWT go example signing methods
View main.go
import (
"fmt"
"io/ioutil"
"time"
"github.com/dgrijalva/jwt-go"
)
func signingWithHMAC() {
@juanpabloaj
juanpabloaj / .gitignore
Last active Oct 23, 2020
go http service with concurrency
@juanpabloaj
juanpabloaj / Dockerfile
Last active Jun 4, 2020
phoenix gitlab monitor and haproxy
View Dockerfile
FROM haproxy:1.7
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
@juanpabloaj
juanpabloaj / Dockerfile
Created May 4, 2020
haproxy strip path prefix
View Dockerfile
FROM haproxy:1.7
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
View d32_pro.ino
// mapping suggestion for ESP32, e.g. LOLIN32 D32 PRO
// BUSY -> 15
// RST -> 2
// DC -> 0
// CS -> 5
// CLK -> SCK(18)
// DIN -> MOSI(23)
// GND -> GND
// 3.3V -> 3.3V
// note: use explicit value for CS
@juanpabloaj
juanpabloaj / main.go
Last active Aug 19, 2019
go template example
View main.go
package main
import (
"os"
"text/template"
"time"
)
type Todo struct {
Name string
@juanpabloaj
juanpabloaj / neovim.spec
Last active Aug 6, 2019
neovim centos 6 spec
View neovim.spec
# yum install -y rpm-build rpmdevtools yum-utils centos-release-scl-rh
# rpmdev-setuptree
# mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
# spectool -g -R rpmbuild/SPECS/neovim.spec
# yum-builddep -y rpmbuild/SPECS/neovim.spec
# source scl_source enable devtoolset-6
# rpmbuild -ba rpmbuild/SPECS/neovim.spec
%define build_timestamp %(date +"%Y%m%d%H%M")
@juanpabloaj
juanpabloaj / main.go
Last active Aug 3, 2019
gobuffalo/plush example
View main.go
package main
import (
"fmt"
"time"
"github.com/gobuffalo/plush"
)
func main() {