Skip to content

Instantly share code, notes, and snippets.

View bgalvao's full-sized avatar
💻

Bernardo bgalvao

💻
View GitHub Profile
@bgalvao
bgalvao / selected_feature_set_hack.ipynb
Created June 14, 2021 10:00
Encode feature selection support on a scikit-learn cross-validation hack.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
%load_ext autoreload
%autoreload 2
import sys
sys.path.append("..")
from scrpts import sample # 'scripts' is a reserved name btw
@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
@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 / .bash_aliases
Last active February 20, 2020 08:57
bashing scripts :: a collection of scripts to help automate some stuff on my linux home
alias ytdl-audio="youtube-dl --audio-quality 0 --embed-thumbnail --format m4a -i"
alias ytdl-video="youtube-dl --audio-quality 0 --embed-thumbnail --format bestvideo -i"
alias clock="tty-clock -s -c -C 3"
@bgalvao
bgalvao / README.md
Last active February 17, 2020 11:17
Command line messaging
@bgalvao
bgalvao / unfollow_all_linkedin.js
Created January 30, 2020 13:09
unfollow on social sites that dont have an unfollow all buttonn
follows = document.querySelectorAll("button.is-following")
follows.forEach(follow => follow.click())
window.location.reload(false)
@bgalvao
bgalvao / install_docker.sh
Created November 13, 2019 16:20
nvidia docker
sudo apt-get remove docker docker-engine docker.io containerd runc -y
sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common -y
@bgalvao
bgalvao / Dockerfile
Last active October 26, 2019 11:30
tensorflow object detection api install
FROM tensorflow/tensorflow:latest-gpu-py3
# add some dependencies
RUN apt install protobuf-compiler git -y
RUN pip3 install Cython contextlib2 pillow lxml matplotlib jupyter jupyterlab
# add tf od api
RUN git clone https://github.com/tensorflow/models.git --depth 1
# add coco metrics