Skip to content

Instantly share code, notes, and snippets.

@halian-vilela
halian-vilela / 1brc.exs
Created September 15, 2024 23:40 — forked from ethanniser/1brc.exs
1 billion row challenge in a SINGLE EXPRESSION WITH ELIXIR!!
Mix.install([
{:explorer, "~> 0.8.0"}
])
# Update to the filepath.
filepath = "./data/weather_stations.csv"
defmodule Challenge do
import Explorer.Series
@halian-vilela
halian-vilela / r_operacoes_vetores.r
Last active June 4, 2022 14:57
R - Operações Básicas com Vetores
# UNIDIMENSIONAL
# Vamos começar do início, e com algo que você já sabe: vetores.
vec <- c(8, 9, 10, 11)
vec # 8 9 10 11
# Consultamos elementos específicos utilizando colchetes
# (Observe que R começa a contar a partir de 1)
vec[1] # 8
letters[18] # "r"
LETTERS[13] # "M"
month.name[9] # "September"
@halian-vilela
halian-vilela / latex_boxes_examples.Rmd
Created February 2, 2022 15:03
Some boxed text examples using tcolorbox LaTeX library
---
title: "LaTeX Box Test"
author: "Halian Vilela"
date: "2/2/2022"
header-includes:
- \usepackage{tcolorbox}
- \tcbuselibrary{raster}
output: pdf_document
---
@halian-vilela
halian-vilela / legend_customization.R
Created January 28, 2022 21:27
ggplot2 legend customization
ggplot2::ggplot(data = mtcars, aes(x = mpg, y = wt) ) +
geom_smooth(method = "lm", se = FALSE, aes(alpha = "A") ) +
geom_point(aes(alpha = "B"), size = 3) +
geom_point(aes(alpha = "C"), size = 3) +
## This will let you customize legend aesthetics as you want...
scale_alpha_manual(name = NULL,
values = c(1, 1, 1),
breaks = c("A", "B", "C"),
guide = guide_legend(override.aes = list( shape = c(21,21,22),
linetype = c(1,1,1),
@halian-vilela
halian-vilela / gcloud_speech_recognition.Rmd
Created November 24, 2021 01:47
Google Cloud Speech Recognition - Fluxo de Trabalho
---
title: "Google Cloud Speech Recognition - Fluxo de Trabalho"
author: "Halian Vilela"
date: "13/11/2019"
output:
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
@halian-vilela
halian-vilela / tz_verification
Created September 11, 2021 20:57
tz verification
I am attesting that this GitHub handle halian-vilela is linked to the Tezos account tz1f3KAYDr5xTYXb9mtHdUBmcoQf6cmQfit5 for tzprofiles
sig:edsigtzPNccYVDNfPZ2qhFVdyHPofoAzaWrWVJ3ddGAQx9EWk6cg7tgPxKG2WUvHMFiXFnDGyZWQGMGLLguMDfTPcHnVQJVYoQM
@halian-vilela
halian-vilela / 2021-07-12_poscast_list.txt
Created July 12, 2021 03:06
2021-07-12 - Podcast list
Automators
CorConsult Rx: Evidence-Based Medicine and Pharmacy
Darknet Diaries
Data Hackers
Data Skeptic
Data Stories
Data Viz Today
Economic Rockstar
egghead.io developer chats
Elixir Mix
@halian-vilela
halian-vilela / toTitleCasePT.R
Created May 14, 2021 16:40 — forked from jjesusfilho/toTitleCasePT.R
Converts Portuguese strings to Title Case
#' Convertion to title case with lower case for some classes of words.
#'
#' In written Portuguese, when converting to title case, it is not usual
#' to keep in title case some words, like prepositions, conjunctions,
#' articles and some kinds of pronouns. This functions locates those
#' cases and converts them to lower case.
#'
#' @param string vector of characters to be converted to title case
#' but with connector words (one-word prepositions and conjunctions)
#' and articles (both definite and indefinite) and some pronouns
library(shiny)
library(palmerpenguins)
library(tidyverse)
pg <- penguins %>%
filter(!is.na(sex)) %>%
count(island, sex)
ui <- fluidPage(
fluidRow(
@halian-vilela
halian-vilela / GAS-Trigger-TestingFunction.gs
Created February 21, 2019 11:54 — forked from hlecuanda/GAS-Trigger-TestingFunction.gs
A pattern to debug google apps script (GAS) triggered functions.
/**
* Test function for onEdit. Passes an event object to simulate an edit to
* a cell in a spreadsheet.
*
* Check for updates: http://stackoverflow.com/a/16089067/1677912
*
* See https://developers.google.com/apps-script/guides/triggers/events#google_sheets_events
*
* on Script editor, set to debug THIS function, but create breakpoints
* on the onEdit Function