Skip to content

Instantly share code, notes, and snippets.

@zanieb
zanieb / gist:84748b0ca7bff58cdfb4d0068b446d58
Created February 12, 2025 22:21
`python-build-standalone` performance 3.14.0a4 (with default interpreter) vs 3.14.0a5 (with tail call interpreter)
cpython-3.14.0a4-linux-x86_64-gnu (20250205)
cpython-3.14.0a5-linux-x86_64-gnu (20250212)
==========
Performance version: 1.11.0
Report on Linux-6.1.0-26-amd64-x86_64-with-glibc2.36
Number of logical CPUs: 12 (AMD Ryzen 5 3600)
Date: 2025-02-12
All benchmarks:
@auxten
auxten / export-parquet.py
Last active December 9, 2024 07:26
Export PostgreSQL table to 10 Parquet files with chDB in 15 lines
import chdb
# Get total rows
total_rows = int(chdb.query("""
SELECT COUNT(*)
FROM postgresql('192.168.3.135', 'sample_db', 'users', 'postgres', 'mysecretpassword')
""").bytes().strip())
# Calculate rows per file
rows_per_file = -(-total_rows // 10) # Ceiling division
@OhadRubin
OhadRubin / dag.py
Last active December 25, 2024 00:13
import networkx as nx
from itertools import product
"""
When we compare this code with Airflow, the strengths of your code lie in its simplicity, lightweight nature, and the ability to easily integrate with existing Python code:
Simplicity: This code provides a simple and straightforward way to model and work with DAGs without needing to go through the process of setting up and configuring a comprehensive system like Airflow. For smaller teams or projects with less complexity, this can be an advantage.
Lightweight and easy to incorporate: Your code is a compact, single-file solution that can be easily integrated into an existing Python project without having to set up an entire Airflow environment. When your primary focus is on creating task dependencies with parameter combinations, rather than scheduling and monitoring, your code is easier to incorporate.
Focused on task generation: Your code emphasizes creating a Cartesian product of tasks associated with nodes' parameters. It is geared towards tackling
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
@nginx-gists
nginx-gists / Dockerfile
Last active September 22, 2024 05:55
Our Roadmap for QUIC and HTTP3 Support in NGINX
# Builds NGINX from the QUIC+HTTP/3 development branch
# - Based on the official NGINX docker image, including all modules built by default
# - OpenSSL replaced with LibreSSL to support QUIC's TLS requirements (statically linked)
#
# docker build --no-cache -t nginx:quic .
# docker run -d -p 443:443 -p 443:443/udp nginx:quic
#
# Note that a suitable configuration file and TLS certificates are required for testing!
# See <https://quic.nginx.org/readme.html> for more info
@rossedman
rossedman / main.tf
Last active December 28, 2024 18:08
Scale homelab into cloud with Tailscale, Terraform and cloud-init
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
}
}
}
provider "digitalocean" {
}
@akihikodaki
akihikodaki / README.en.md
Last active April 14, 2025 16:19
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@zeux
zeux / clang27.md
Last active January 27, 2024 11:45
How does clang 2.7 hold up in 2021?

A friend recently learned about Proebsting's law and mentioned it to me off hand. I knew about the law's existence but I never really asked myself - do I believe in it?

For people who aren't aware, Proebsting's law states:

Compiler Advances Double Computing Power Every 18 Years

Which is to say, if you upgrade your compiler every 18 years, you would expect on average your code to double in performance on the same hardware.

Let's C about this

@doole
doole / wine32_macos.org
Last active September 20, 2024 08:51
Use win32 binaries on macOS 10.15/11.0

macOS wine 32/64-bit Setup

Run 32-bit apps on macOS Catalina (10.15) and Big Sur (11.0).

Installation

Dependencies

First install homebrew brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"