Skip to content

Instantly share code, notes, and snippets.

View moniquelive's full-sized avatar
🏳️‍⚧️

Cyber Oliveira moniquelive

🏳️‍⚧️
View GitHub Profile
@moniquelive
moniquelive / gist:1324502
Created October 29, 2011 14:21
Bash prompt
NEUTRAL="\[\e[0m\]"
GRAY="\[\e[0;37m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
YELLOW="\[\e[1;33m\]"
WHITE="\[\e[1;37m\]"
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export PS1="${GRAY}\t \$(__git_ps1 '(${BLUE}%s${NEUTRAL})')${WHITE}\u${NEUTRAL}@${GREEN}\h${WHITE}:${YELLOW}\w${GRAY}$ "
@moniquelive
moniquelive / gist:1478644
Created December 14, 2011 21:31
.gitconfig [alias]'es
[alias]
br = branch
co = checkout
ci = commit
dc = diff --cached --color-words --minimal
s = status -sb
sh = show --color-words --minimal
st = status
pu = push
fe = fetch
@moniquelive
moniquelive / .tmux.conf
Created April 13, 2012 02:27
TMUX config file
# VI mode
set -g mode-keys vi
set -g status-keys vi
# increase history limit
set -g history-limit 9999
# counting from 1 (instead of 0)
set -g base-index 1
#!/usr/bin/env python
enddays = [0, 31,28,31,30,31,30,31,31,30,31,30,31]
def output_transactions(saldo, days):
this_year = 2010 #datetime.datetime.now().year
dtstart = datetime.date(this_year, days.keys()[1].month, 1)
dtend = datetime.date(this_year, dtstart.month, enddays[dtstart.month])
for day in daterange(dtstart, dtend):
if day in days.keys():
### Keybase proof
I hereby claim:
* I am lccro on github.
* I am cyberleo (https://keybase.io/cyberleo) on keybase.
* I have a public key whose fingerprint is 24B8 E2A0 F1D5 BD38 A810 55D3 0DFC A688 E107 BFCF
To claim this, I am signing this object:
@moniquelive
moniquelive / random_theme.vim
Last active September 14, 2015 04:25
Load random VIM theme
" Random themes!
set t_Co=256
syntax on
function! s:pick_random_theme()
lua <<EOF
math.randomseed(os.time())
local themes = {'BlackSea', 'Chasing_Logic', 'CodeFactoryv3', 'Monokai', 'MountainDew', 'SlateDark', 'Tomorrow-Night', 'Tomorrow-Night-Eighties', 'abra', 'anotherdark', 'apprentice', 'asu1dark', 'babymate256', 'badwolf', 'base16-atelierdune', 'bensday', 'billw', 'blackboard', 'blackdust', 'blacklight', 'blazer', 'bluechia', 'bluegreen', 'blugrine', 'bocau', 'bubblegum', 'burnttoast256', 'busybee', 'bvemu', 'camo', 'candy', 'candycode', 'candyman', 'carvedwood', 'chance-of-storm', 'chocolate', 'clearance', 'cobaltish', 'codeschool', 'coffee', 'corn', 'corporation', 'cthulhian', 'darkBlue', 'darkZ', 'darkbone', 'darkburn', 'darkeclipse', 'darker-robin', 'darkerdesert', 'darkocean', 'darkrobot', 'darkspectrum', 'desert', 'desert256v2', 'desertEx', 'desertedocean', 'detailed', 'distinguished', 'doriath', 'dusk', 'earendel', 'eclm_wombat', 'ecostation', 'ego', 'ekinivim', 'elise', 'flatcolor', 'flatlan
cmake -D WITH_TBB=ON -D WITH_OPENMP=ON -D WITH_IPP=ON -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CSTRIPES=ON -D WITH_OPENCL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D CMAKE_INSTALL_PREFIX=/usr/local/ -D WITH_QT=ON -D WITH_OPENGL=ON -D BUILD_opencv_python3=ON -D PYTHON3_EXECUTABLE=$(which python3) -D PYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -D PYTHON_INCLUDE_DIR2=$(python3 -c "from os.path import dirname; from distutils.sysconfig import get_config_h_filename; print(dirname(get_config_h_filename()))") -D PYTHON_LIBRARY=$(python3 -c "from distutils.sysconfig import get_config_var;from os.path import dirname,join ; print(join(dirname(get_config_var('LIBPC')),get_config_var('LDLIBRARY')))") -D PYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c "import numpy; print(numpy.get_include())") -D PYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_pyth
import numpy as np
import cv2
def mask_it(img, points):
height, width, depth = img.shape
mask = np.zeros( (height, width), np.uint8)
cv2.fillPoly(mask, pts = np.int32([points]), color=(255,255,255))
return cv2.bitwise_and(img,img, mask=mask)
@moniquelive
moniquelive / scraping_lol.py
Created March 17, 2021 02:04
Scrapes br.op.gg in order to download last 10 victories of "onde fica jungle"
#!/usr/bin/env python
import urllib.request
from bs4 import BeautifulSoup
url = 'https://br.op.gg/summoner/userName=onde+fica+jungle'
with urllib.request.urlopen(url) as u:
doc = BeautifulSoup(u, 'html.parser')
game_results = doc.select('.GameResult')
@moniquelive
moniquelive / github_jobs.js
Created March 26, 2021 02:35
Google Sheets App Script to retrieve github jobs
function fetchGHData_(description) {
const url = "https://jobs.github.com/positions.json?description=" + description;
const response = UrlFetchApp.fetch(url, { 'muteHttpExceptions': true });
const json = response.getContentText();
return JSON.parse(json);
}
function fillInTheBlanks() {
const TITLE_COLUMN = 0;
const COMPANY_COLUMN = 1;