Skip to content

Instantly share code, notes, and snippets.

Breno brenorb

  • BBrito
  • Brasília, Brazil
Block or report user

Report or block brenorb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brenorb
brenorb / optimal_portfolio.py
Created May 30, 2020
Making a graph of optimal portfolio
View optimal_portfolio.py
import pandas as pd, numpy as np
import yfinance as yf
import datetime as dt
import re
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
plt.rcParams['figure.figsize'] = [10,6]
plt.rcParams["font.weight"] = "bold"
plt.rcParams["axes.labelweight"] = "bold"
@brenorb
brenorb / emoji_cheatsheet.md
Last active Jul 12, 2019 — forked from roachhd/README.md
😛📑 EMOJI cheatsheet
View emoji_cheatsheet.md

Emoji Cheatsheet

People

:bowtie: - :bowtie: 😄 - :smile: 😆 - :laughing: 😊 - :blush:

@brenorb
brenorb / get_print.py
Created Jun 13, 2019
Simple way to keep track of results printed but not returned
View get_print.py
# from https://www.kaggle.com/kmader/july-24-micro-challenge
from contextlib import redirect_stdout
from io import StringIO
def simulate_game(verbose=False):
out_buffer = StringIO()
with redirect_stdout(out_buffer):
blackjack.simulate_one_game()
out_str = out_buffer.getvalue()
if verbose:
@brenorb
brenorb / tweet_dumper.py
Last active Jun 4, 2020 — forked from yanofsky/tweet_dumper.py
A Python 3.+ script to download all of a user's tweets into a csv.
View tweet_dumper.py
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@brenorb
brenorb / nubank_parser.ipynb
Last active May 24, 2019
Nubank expenses CSV maker
View nubank_parser.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brenorb
brenorb / bricx.txt
Created May 7, 2019
PID controller for Lego bot
View bricx.txt
/* Techbricks.nl Line Follower
Based on a PID controller, using the NXT 1.0 light sensor
NXC firmware 1.28
www.techbricks.nl
last modified 03/03/2010 Breno version*/
/* Proportional gain, straight forward reaction of the controller
Larger values typically mean faster response since the larger the error,
the larger the proportional term compensation.
An excessively large proportional gain will lead to process instability and oscillation.*/
@brenorb
brenorb / poker.test.js
Created May 4, 2019
Javascript/Node.js TDD with jest. https://jestjs.io/
View poker.test.js
import { checkFiveCards, checkCard, checkHand, higherCard } from './poker';
// Should use 'export function' for functions in './poker' file
describe('Checar 5 cartas', () => {
test('checa mão com cinco cartas', () => {
expect(checkFiveCards('2H 3D 5S 9C KD')).toEqual(true);
});
test('checa mão com 4 cartas', () => {
expect(checkFiveCards('2H 3D 5S 9C')).toEqual(false);
View test_TDD_pytest.py
import twittter_main
# Execute Pytest in the cmd to assert the test.
def test_post_sem_usuario_sem_msg():
assert twittter_main.post('->') == 'Comando invalido!'
def test_post_sem_msg():
assert twittter_main.post("Alice ->") == "Post sem mensagem!"
@brenorb
brenorb / DateSync.bat
Created Jan 8, 2019
Syncs computer date and time. Must execute as admin.
View DateSync.bat
net start w32time
w32tm /resync /force
net stop w32time
@brenorb
brenorb / download.sh
Created Jan 8, 2019
Shell script to update code in a double click.
View download.sh
#!/bin/sh
#Updates codes
#Author: Breno Brito
#Updated in 13/04/2018
export dir=$PWD
echo Updating website
echo
cd $dir/website
You can’t perform that action at this time.