Skip to content

Instantly share code, notes, and snippets.

View bgalvao's full-sized avatar
💻

Bernardo Galvão bgalvao

💻
View GitHub Profile
@bgalvao
bgalvao / redirect.html
Created May 3, 2020 11:39
redirect to avoid procrastination
<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>redirect</title><link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700|Roboto:300,300i,400,400i,700,700i&subset=latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
@bgalvao
bgalvao / grid_search.py
Last active August 13, 2020 15:40
Grid Search Examples
import datetime
import pickle
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit, GridSearchCV
%load_ext autoreload
%autoreload 2
import sys
sys.path.append("..")
from scrpts import sample # 'scripts' is a reserved name btw
@bgalvao
bgalvao / .theme_dark.sh
Created March 16, 2021 10:34
theme toggling on xfce4
THEME="vimix-dark-laptop-amethyst"
echo $THEME
# change icon theme
ICON_THEME="Vimix-White-dark"
xfconf-query --channel xsettings --property /Net/IconThemeName --set $ICON_THEME
# change window style
xfconf-query -c xsettings -p /Net/ThemeName -s $THEME
@bgalvao
bgalvao / selected_feature_set_hack.ipynb
Created June 14, 2021 10:00
Encode feature selection support on a scikit-learn cross-validation hack.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bgalvao
bgalvao / kde_chrome_app_icons.py
Last active July 3, 2022 16:31
Make the fix so that kde shows chrome app icons, like in https://superuser.com/a/1068709. Loops through desktop files in ~/Desktop.
#!/usr/bin/env python3
import os
from shutil import copyfile
home_dir = os.getenv('HOME') # only works on Linux
desktop_dir = os.path.join(home_dir, 'Desktop')
chrome_based_browsers = ['brave', 'chrome', 'chromium', 'vivaldi']
@bgalvao
bgalvao / minikube
Last active October 27, 2021 09:21
Output of minikube start --kubernetes-version=v1.17.17 for an #94 opened in OpenMLOps https://github.com/datarevenue-berlin/OpenMLOps/issues/94
(base) [user@machinelmao openmlops]$ minikube start --kubernetes-version=v1.17.17
😄 minikube v1.23.2 on Arch 21.1.6
✨ Using the docker driver based on user configuration
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
🔥 Creating docker container (CPUs=2, Memory=3900MB) ...
🐳 Preparing Kubernetes v1.17.17 on Docker 20.10.8 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
💢 initialization failed, will try again: wait: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.17:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerificatio
@bgalvao
bgalvao / settings.json
Created November 27, 2021 11:09
hella fine vscode preferences 👌
{
"workbench.colorTheme": "Mayukai Mirage Gruvbox Darktooth",
"gitlens.hovers.currentLine.over": "line",
"gitlens.codeLens.enabled": false,
"files.associations": {
"*.nomad": "terraform",
"*.hcl": "terraform"
},
"editor.fontFamily": "'Iosevka', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontWeight": "bold",
@bgalvao
bgalvao / .env
Created December 7, 2021 12:33
Support gist for opening issue on mlflow/mlflow
MLFLOW_DB_NAME=mlflow_db
MLFLOW_DB_PASSWORD=use_vault
MLFLOW_DB_CONNECTION_URI=postgresql+asyncpg://postgres:${MLFLOW_DB_PASSWORD}@mlflow-db:5432/${MLFLOW_DB_NAME}
@bgalvao
bgalvao / cli_workflow.md
Last active March 31, 2022 11:55
Docker Compose/Stack templating and file generation using jsonnet and yq

Prereqs: install jsonnet, yaml2jsonnet (optional) and yq:

If you already have .yaml files lying around, or prefer to start with them, you don't have to start from scratch: convert them to jsonnet using yaml2jsonnet

yaml2jsonnet ../config/authelia/configuration.yaml | jsonnetfmt - -o config.authelia.jsonnet

Let that be your starting point. Now edit to your will. If you want to test it (see what it renders) or save it, then: