Skip to content

Instantly share code, notes, and snippets.

View alexandreio's full-sized avatar

Alexandre alexandreio

  • Fourth Sail
  • Minas Gerais, Brazil
View GitHub Profile
@yzdbg
yzdbg / auto-dr.md
Last active November 3, 2023 17:11

Automating Daily Reports, because fuck it, really...

Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.

So now, there's a scribe for that :

auto-dr-

Code

@rain-1
rain-1 / LLM.md
Last active October 20, 2025 07:02
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@belm0
belm0 / article_sc_and_lua_1.md
Last active July 29, 2025 15:40
Structured concurrency and Lua (part 1)

Structured concurrency and Lua (part 1)

John Belmonte, 2022-Sep

I've started writing a toy structured concurrency implementation for the Lua programming language. Some motivations:

  • use it as a simple introduction to structured concurrency from the perspective of Lua (this article)
  • learn the fundamental properties of structured concurrency and how to implement them
  • share code that could become the starting point for a real Lua library and framework

So what is structured concurrency? For now, I'll just say that it's a programming paradigm that makes managing concurrency (arguably the hardest problem of computer science) an order of magnitude easier in many contexts. It achieves this in ways that seem subtle to us—clearly so, since its utility didn't reach critical mass until around 2018[^sc_birth] (just as control structures like functions, if, and while weren't introduced to languages until long after the first compu

@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
@perone
perone / bayesian_enem.ipynb
Last active November 7, 2018 12:48
Análise bayesiana microdados enem
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sam95
sam95 / install_kafka.md
Last active June 13, 2019 19:45
Installation and Getting started with Apache-Kafka for OSX

Apache Kafka is a highly-scalable publish-subscribe messaging system that can serve as the data backbone in distributed applications. With Kafka’s Producer-Consumer model it becomes easy to implement multiple data consumers that do live monitoring as well persistent data storage for later analysis. You can assume that RabbitMQ is similar to Kafka, You do get an option for message-sending or Broadcasting. The installation process for OSX is as below.

  1. The best way to install the latest version of the Kafka server on OS X and to keep it up to date is via Homebrew.

     brew search kafka
     brew install kafka 
    
  2. The above commands will install a dependency called zookeeper which is required to run kafka. Start the zookeeper service.

zkserver start

@yxy
yxy / two-railway-programing-in-python.py
Last active September 16, 2021 17:03
Railway Oriented Programming in python. inspired by https://fsharpforfunandprofit.com/rop/
class Success(object):
def __init__(self, value):
self.value = value
class Error(object):
def __init__(self, value):
self.value = value
class wrapper(object):
def __init__(self, result):
@tj
tj / update.js
Last active April 29, 2023 14:53
shouldComponentUpdate utility
let rows = {}
export default function(props = [], state = []) {
return function(target) {
const proto = Object.create(target.prototype)
proto.shouldComponentUpdate = function(newProps, newState) {
let id = (this._update_id = this._update_id || Math.random())
@akrylysov
akrylysov / asyncio_producer_consumer.py
Last active June 30, 2024 09:20
Python 3 asyncio basic producer / consumer example
import asyncio
import random
q = asyncio.Queue()
async def producer(num):
while True:
await q.put(num + random.random())
await asyncio.sleep(random.random())
@snehesht
snehesht / Concurrent HTTP Requests with Python3 and asyncio
Last active October 20, 2020 19:00
Concurrent HTTP Requests with Python3 and asyncio
#http://geekgirl.io/concurrent-http-requests-with-python3-and-asyncio/
Concurrent HTTP Requests with Python3 and asyncio
My friend who is a data scientist had wipped up a script that made lots (over 27K) of queries to the Google Places API. The problem was that it was synchronous and thus took over 2.5hours to complete.
Given that I'm currently attending Hacker School and get to spend all day working on any coding problems that interests me, I decided to go about trying to optimise it.
I'm new to Python so had to do a bit of groundwork first to determine which course of action was best.