Skip to content

Instantly share code, notes, and snippets.

View celiomarcos's full-sized avatar
:shipit:

Celio Marcos celiomarcos

:shipit:
View GitHub Profile
@ErickWendel
ErickWendel / concat-streams.mjs
Last active August 15, 2024 10:17
Example of how to consume multiple Web APIs in parallel via Node.js Streams
// npm i axios stream-concat
import { pipeline } from 'stream/promises'
import StreamConcat from 'stream-concat'
import axios from 'axios'
const API_01 = 'http://localhost:3000'
const API_02 = 'http://localhost:4000'
const streams = (await Promise.all([
axios({
@MichaelCurrie
MichaelCurrie / dataframe_fast.py
Last active August 4, 2024 23:33
Fast pandas DataFrame read/write to mariadb
#!/usr/bin/env python3
"""
Drop-in replacement for pandas.DataFrame methods for reading and writing to database:
pandas.DataFrame.to_sql
pandas.read_sql_table
For some reason the current (Jan 2023) implementation in Pandas
using sqlalchemy is really slow. These methods are ~300x faster.