Skip to content

Instantly share code, notes, and snippets.

View Andrei-WongE's full-sized avatar
💭
I may be slow to respond.

Andrei-WongE Andrei-WongE

💭
I may be slow to respond.
View GitHub Profile
library(tidycensus)
library(tigris)
library(tidyverse)
library(sf)
library(ggiraph)
library(patchwork)
options(tigris_use_cache = TRUE)
set.seed(123456)
# Get a list of counties within the Austin CBSA using tigris
snippet fragment
[${1:text}]{.${2:type}}
snippet aside
[${1:text}]{.aside}
snippet fence
:::{.${1:type}}
${2:body}
:::
@veekaybee
veekaybee / normcore-llm.md
Last active July 28, 2024 18:55
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@tim-salabim
tim-salabim / layer_selector.R
Created February 25, 2023 13:29
layer selector
library(mapview)
library(leafem)
library(leaflet)
library(sf)
library(geojsonsf)
franc_ext <- unname(as.vector(st_bbox(franconia)))
francgj = geojsonsf::sf_geojson(franconia)
leaflet() |>
@AlbertRapp
AlbertRapp / label_cleaning.R
Created February 18, 2023 14:18
3 ways to relabel data
library(tidyverse)
big_tech_companies <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-02-07/big_tech_companies.csv')
big_tech_companies
# # A tibble: 14 × 2
# stock_symbol company
# <chr> <chr>
# 1 AAPL Apple Inc.
# 2 ADBE Adobe Inc.
# 3 AMZN Amazon.com, Inc.
# 4 CRM Salesforce, Inc.
@AlbertRapp
AlbertRapp / penguins_table_gradient.R
Created October 26, 2022 14:30
penguins_table_gradient.R
library(tidyverse)
library(gt)
filtered_penguins <- palmerpenguins::penguins |>
filter(!is.na(sex))
penguin_weights <- palmerpenguins::penguins |>
filter(!is.na(sex)) |>
group_by(species) |>
summarise(
@midudev
midudev / README.md
Created October 15, 2022 17:52
Transcribe vídeo de YouTube con Whisper e Inteligencia Artificial

Requisitos

Necesitas tener instalado Python 3.9 e instalar la dependencia de Whisper y PyTube:

pip install git+https://github.com/openai/whisper.git
pip install pytube

También necesitas tener instalado ffmpeg. Según tu sistema operativo se instala de esta forma:

@RamiKrispin
RamiKrispin / gist:fff84af2622927d82d1dd369d77e3210
Created September 19, 2022 12:26
RStudio_server_docker.sh
#!/bin/bash
# Launching RStuido server on a docker with different settings
# Basic run command to launce rocker container with RStudio Server
docker run -d -p 8787:8787 \
-e USER=rstudio -e PASSWORD=rstudio \
rocker/rstudio:4.2
# Disabling the authentication
# to create the plots in this Twitter thread: https://twitter.com/MeghanMHall/status/1560411406935138305
library(tidyverse)
library(ggrepel)
library(scales)
df1 <- txhousing %>%
filter(city %in% c("Houston","Austin")) %>%
group_by(year, city) %>%
summarize(avg = mean(median, na.rm = TRUE)) %>%
@acoppock
acoppock / power_depends_on_arms
Created June 27, 2022 13:37
DeclareDesign simulation to see how power changes as we increase the number of arms (with corrections)
library(DeclareDesign)
library(tidyverse)
library(geomtextpath)
design_1 <-
declare_model(N = 1000,
U = rnorm(N),
Y_Z_0 = U,
Y_Z_1 = U + 0.2) +
declare_assignment(Zk = complete_ra(N = N, num_arms = k)) +