Skip to content

Instantly share code, notes, and snippets.

View huogerac's full-sized avatar
:octocat:

Roger Camargo huogerac

:octocat:
View GitHub Profile
#!/bin/bash
# This script is based on
# https://medium.com/welcome-to-the-django/guia-definitivo-para-organizar-meu-ambiente-python-a16e2479b753
PYTHON2_VERSION='2.7.12'
PYTHON3_VERSION='3.5.2'
sudo apt-get install -y git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
sudo pip install virtualenvwrapper
@huogerac
huogerac / redis.sh
Created March 3, 2018 21:17
ascii-art-block
_._
_.-`` ''-._
_.-`` O ''-._
.-`` ''-._
( O )
|`-._ _.-'|
| `-._ _.-' |
`-._ `-._ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
filmes = pd.read_csv("regressao_linear_alura.csv")
amostra = filmes.sample(n=200)
@huogerac
huogerac / tarefa_01_cenarios_teste
Created September 26, 2017 00:34
Teste Elevador
Cenário 1
==========
"Elevador é chamado 2 vezes antes da descida"
Dado um predio de 10 andares com 1 elevador
Quando o elevador é chamado no 5o e em seguida no 9o.
Então o elevador deverá iniciar a subida até o 9o, iniciar
a descida parando no 5o. e finalmente até o térreo.
@huogerac
huogerac / speechtotext.js
Created June 3, 2017 06:00
NodeJS accessing google api - real time
// I need to
// npm install sox and node-record-lpcm16
// export GOOGLE_APPLICATION_CREDENTIALS=My generate key json file
const record = require('node-record-lpcm16');
// Imports the Google Cloud client library
const Speech = require('@google-cloud/speech');
const projectId = 'my-project';
@huogerac
huogerac / CHANNEL UP
Last active January 26, 2017 20:44
SAMSUNG LCD remote control
CHANNEL UP
--- press 1st time
------> EVENT
Object
code:false
ir-1:true
raw:Array[135]
[0 … 99]
0:"4080"
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y \
libmysqlclient-dev \
libtiff4-dev \
libjpeg8-dev \
zlib1g-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev \
#!/usr/bin/env python
from __future__ import unicode_literals
import os
import codecs
import argparse
import inspect
import sys
import re
import csv
"""
This is the logic to help you save money
>>> cofrinho(2016)
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104]
>>> cofrinho(2016, group_by='month')
[20, 52, 84, 150, 156, 188, 280, 260, 370, 332, 364, 500]
>>>