Skip to content

Instantly share code, notes, and snippets.

View prefect_test.py
import string
from prefect import Task, Flow, Parameter
class BasicTask1(Task):
def __init__(self, **kwargs):
self.a = []
super().__init__(**kwargs)
def run(self, x: str = '') -> str:
@microft
microft / .zshrc
Created Apr 23, 2020
simple zsh functions to create and use python 3 virtualenvs based on the directory name
View .zshrc
WORKON_HOME=/home/microft/.virtualenvs
workon(){
cd $1;
source $WORKON_HOME/${PWD##*/}/bin/activate
return 0;
}
mkvenv(){
python3 -m venv $WORKON_HOME/$1
}
View keybase.md

Keybase proof

I hereby claim:

  • I am microft on github.
  • I am luisbraga (https://keybase.io/luisbraga) on keybase.
  • I have a public key ASBF7WEt1jT8maY_cOou8Lm_cxv8y1N0ayQ6t00tQqQTfgo

To claim this, I am signing this object:

@microft
microft / .zshrc
Created Apr 9, 2020
smileyface in zsh PS1
View .zshrc
function smileyface
{
case $? in
0 )
echo -ne "$fg[green] :)"
;;
1 )
echo -ne "$fg[red] ;("
;;* )
echo -ne "$fg[yellow] %%("
@microft
microft / covid.py
Created Apr 4, 2020
get the data from worldometers coronavirus page and display in console
View covid.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from tabulate import tabulate
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(options=chrome_options)
driver.get('https://www.worldometers.info/coronavirus/')
output_table = []
table = driver.find_element_by_xpath('//*[@id="main_table_countries_today"]/thead[1]')
row = table.find_elements_by_tag_name("tr")[0] # get all of the rows in the table
@microft
microft / 50-marblemouse.conf
Created Feb 9, 2019
xorg configuration for left handed logitech marble mouse (middle click and scroll) - Ubuntu 18.04
View 50-marblemouse.conf
Section "InputClass"
Identifier "Logitech USB Trackbal"
MatchProduct "Logitech USB Trackball"
Driver "libinput"
Option "MiddleEmulation" "on"
Option "ScrollMethod" "button"
#Option "ButtonMapping" "1 2 3 4 5 6 7 8 9" # right handed
#Option "ScrollButton" "8" # right handed
Option "ScrollButton" "9" # left handed
Option "ButtonMapping" "3 9 1 4 5 6 7 2 8" #left handed
@microft
microft / gideon.py
Created Nov 29, 2016
a small Flask service
View gideon.py
from __future__ import division
import logging
from flask import Flask, request, jsonify
from gensim import corpora, models, similarities
SIMILARITY_THRESHOLD = 0.5
INDUSTRIES = {
'funding': {},
'txt50': {}
View gist:2a2c9ea8db83bd8af4818cf76f1c99ed
javascript:location.href='http://attentive.us/api/article/new/?url='+encodeURIComponent(location.href)
View gist:9c2c5343b95459a41dc4
[default] -- /vagrant
Failed to mount folders in Linux guest. This is usually beacuse
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant
@microft
microft / gist:5213590
Created Mar 21, 2013
my ~/.gitconfig
View gist:5213590
[user]
name = Luis Miguel Braga
email = luismiguel@silvabraga.com
[color]
ui = true
[alias]
lol = log --oneline --graph --decorate
pullall = submodule foreach git pull origin master
[core]
excludesfile = ~/.gitignore_global