Skip to content

Instantly share code, notes, and snippets.

View lpirola's full-sized avatar

Lucas Pirola lpirola

  • São Paulo, Brazil
View GitHub Profile
@adtac
adtac / Dockerfile
Last active May 28, 2024 01:38
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@fernandobarbalho
fernandobarbalho / gist:0cf27d994e39700663551b2d14387b08
Created August 5, 2019 15:20
Com essa função é possível programaticamente baixar todos os dados que se queira do datasus apenas alterando os parâmetros de uma função.
hack_datasus <- function(sistema, modalidade, tipo_arquivo, ano, UF, mes){
#Função gera dataframe a partir de ftp feita na página do datasus
#sistema ex:'SIHSUS' Verificar os sistemas disponíveis em http://www2.datasus.gov.br/DATASUS/index.php?area=0901&item=1
#modalidade 'dados'
#tipo_arquivo ex: 'RD'#Varia conforme o sistema
#ano ex: 17 Dois últimos dígitos do ano
#UF ex:'AL' Sigla de UF Brasileira
#mes ex:'12' strings entre 01 e 12
@halhen
halhen / codes.csv
Last active February 18, 2024 22:49
The people who keep us company - dataviz
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 1 column, instead of 2. in line 7.
code;name
01;Personal Care Activities
0101;Sleeping
0102;Grooming
0103;Health-related self care
0104;Personal Activities
0105;Personal Care Emergencies
0199;Personal care, n.e.c.*
02;Household Activities
0201;Housework
@luizalbsilva
luizalbsilva / img-I-00.png
Last active January 20, 2017 16:12
MailChimp
img-I-00.png
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=php_cache:100m inactive=1d;
fastcgi_cache_key "$scheme://$host$request_uri";
server {
listen 80;
server_name montefuscolo.com.br www.montefuscolo.com.br;
return 301 https://montefuscolo.com.br$request_uri;
}
server {
@leonardofed
leonardofed / README.md
Last active July 5, 2024 01:31
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


meu_tema <- function(base.size = 9, legend.text.size = 9, axis.text.size = 10, axis.title.size = 11) {
# exemplo da função lm
#ggplot(agua_agregado, aes(x = dif_pressao, y = vazao_massica_media)) +
# geom_point() + geom_smooth(method = "lm") +