Skip to content

Instantly share code, notes, and snippets.

View ibombonato's full-sized avatar

Icaro Bombonato ibombonato

View GitHub Profile
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1;QueueEndpoint=http://host.docker.internal:10001/devstoreaccount1;
AZURE_CONTAINER=ui-container
SFTP_HOST=host.docker.internal
SFTP_USER=foo
SFTP_PASS=pass
SFTP_FOLDER=/upload
POSTGRES_HOST=host.docker.internal
POSTGRES_PORT=5433
@ibombonato
ibombonato / date_in_bat.bat
Last active October 17, 2022 13:12
Get local date in .bat file - bash script
@echo off
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set actual_date=%ldt:~0,4%%ldt:~4,2%%ldt:~6,2%
echo Local date is %actual_date%
SET MY_PROGRAM=E:/TempoSilencio/silence_extractor.exe
SET MY_BASE_PATH=I:\SPEECHMINER\PROCESSADO
SET MY_COMMAND=%MY_PROGRAM% "%MY_BASE_PATH%" "%actual_date%" "%actual_date%"
@ibombonato
ibombonato / instruções.md
Last active May 31, 2019 16:10
Instruções procedimento de ping

POC de Screen Capture

Objetivo

Realizar o ping em uma url deteminada e anotar o IP, tempo médio e máximo.

Intruções para realizar o procedimento

Passos/Forma de preenchimento ideal

@ibombonato
ibombonato / sql_parallel_foreach_example.r
Created March 1, 2019 18:32
R run sql query in parallel with foreach, DBI and odbc packages
library(foreach)
library(doParallel)
library(DBI)
#Creating the cluster
cl <- makeCluster(detectCores() -1)
# Defining packages and variables for cluster
clusterEvalQ(cl, {
library(odbc)
@ibombonato
ibombonato / text_to_sequence_keras.R
Created July 19, 2017 18:01
Using text to sequence in R with Keras
library(keras)
texts <- c("Today I got to the movie",
"Yesterday we got to the movie",
"Today was cold at the movie",
"Somethign happened yesterday")
tok <- keras::text_tokenizer(num_words = 5)
keras::fit_text_tokenizer(tok, texts)
@ibombonato
ibombonato / dockerfile
Created April 14, 2017 20:48
Dockerfile for Rstudio with SQL Driver 13 and RODBC package
FROM rocker/tidyverse
RUN echo "deb http://ftp.debian.org/debian sid main" | tee -a /etc/apt/sources.list.d/sid.list
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
apt-transport-https \
libssl-dev \
libsasl2-dev \
openssl \
curl \
@ibombonato
ibombonato / rvest_fake_submit.R
Created March 3, 2017 18:31
Rvest with fake submit
require(rvest)
#website
url <- ("http://www.anbima.com.br/est_termo/Curva_Zero.asp")
pgsession <- html_session(url)
pgform <-html_form(pgsession)[[1]]
fake_submit <- list("name" = NULL,
"type" = "submit",
"value" = "Submit",
@ibombonato
ibombonato / read_all_csv_purrr.r
Created February 2, 2017 15:16
R - Read all csv in folder with purrr
library(tidyverse)
files <- list.files(path = "./data/", pattern = "*.csv")
df <- files %>%
map(function(x) {
read.csv(paste0("./data/", x))
}) %>%
reduce(rbind)
@ibombonato
ibombonato / plot_all_variables.R
Created December 2, 2016 17:21
Plotting all variables from a data frame
library(ggplot2)
library(tidyverse)
df <- mtcars %>%
gather(-mpg, key="var", value = "value")
ggplot(df, aes(x = value, y = mpg)) +
geom_point(alpha = 0.3) +
geom_smooth(method = "lm") +
facet_wrap(~var, scales = "free") +
@ibombonato
ibombonato / tidyr_spread.R
Created October 18, 2016 20:14
How to transform rows to columns using spread in tidyr.
df <- data.frame(
id = c(1,1,2,2,2),
columnFields = c("column 1", "column 2", "column 1", "column 2", "column 3"),
valueFields = c(1:5))
tidyr::spread(df, columnFields, valueFields)