Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from os import system | |
| from requests import get | |
| from bs4 import BeautifulSoup | |
| headers = {'Accept': 'text/html, application/xhtml+xml, application/xml', | |
| 'Accept-Encoding': 'gzip, deflate, sdch', | |
| 'Accept-Language': 'en-US, en', | |
| 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install.packages(c("ggplot2", "reshape2", "plyr", "languageR", | |
| "lme4", "psych", "RMySQL", "RPostgresSQL", "RSQLite", "xlsx", | |
| "XLConnect", "foreign", "dplyr", "tidyr", "stringr", "lubridate", | |
| "ggplot2", "ggvis", "htmlwidgets", "googleVis", "maptools", | |
| "maps", "ggmap", "zoo", "xts", "quantmod", "httr", "jsonlite", | |
| "sp", "neuralnet", "RODBC", "gmodels", "class", "tm", "wordcloud", | |
| "rpart", "kernlab", "e1071", "randomForest", "caret", "ROCR")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p share | |
| mkdir -p pgdata | |
| docker rm -f local_db || true | |
| docker run --name local_db \ | |
| -e POSTGRES_PASSWORD=secret \ | |
| -p 5432:5432 \ | |
| -v $(pwd)/share:/share \ | |
| -v $(pwd)/pgdata:/var/lib/postgresql/data \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tensorflow.python.client import device_lib | |
| def get_available_devices(): | |
| local_device_protos = device_lib.list_local_devices() | |
| return [x.name for x in local_device_protos] | |
| print(get_available_devices()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import time | |
| from PyQt5.QtWidgets import QApplication, QDialog | |
| from PyQt5.uic import loadUi | |
| class IMC(QDialog): | |
| def __init__(self): | |
| super().__init__() | |
| loadUi('imc.ui', self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import pyodbc as odbc | |
| import datetime | |
| dsn = sys.argv[1] | |
| query_file = sys.argv[2] | |
| csv_file = sys.argv[3] | |
| print(f'Connecting to {dsn}') | |
| print(f'Executing {query_file}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import pyodbc as odbc | |
| import datetime | |
| dsn = sys.argv[1] | |
| query_file = sys.argv[2] | |
| csv_file = sys.argv[3] | |
| print(f'Connecting to {dsn}') | |
| print(f'Executing {query_file}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import pyodbc as odbc | |
| import os | |
| query = 'select * from vendas' | |
| # Trago os dados do servidor caso não exista um cache local, | |
| # senão apenas carrego o cache | |
| if os.path.isfile('./dados/julho_com_sala.csv'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Com este script você cria uma forma de executar comandos | |
| # que não terão acesso à rede externa e Internet. | |
| # Por exemplo, se você quiser forçar o Spotify a fica offline: | |
| # offline spotify.bin | |
| sudo groupadd offline | |
| echo '#!/bin/bash' | sudo tee /usr/local/bin/offline | |
| echo 'sg offline "$*"' | sudo tee -a /usr/local/bin/offline | |
| sudo chmod a+x /usr/local/bin/offline |