Skip to content

Instantly share code, notes, and snippets.

View mgoksu's full-sized avatar

Miraç Göksu Öztürk mgoksu

  • Samsun, Türkiye
View GitHub Profile
@gitname
gitname / README.md
Last active June 10, 2024 09:20
Using `@react-pdf/renderer` with React 18

Using @react-pdf/renderer v3.0.1 with React 18

Introduction

When I tried to use the @react-pdf/renderer package (version 3.0.1) with a React 18 app, two problems arose. In this article, I'll describe those problems and tell you how I solved them.

Update: Here's a video demonstration of the problems and solution described in this article: https://youtu.be/YZP5r7Uy_bU

Problem 1: Dependency Conflict

@rchakode
rchakode / prometheus_exporter_system_resource_usage.py
Last active August 14, 2024 09:30
Sample Python program providing a Prometheus exporter that exposes system CPU and memory usage every 5 minutes.
import prometheus_client
import time
import psutil
UPDATE_PERIOD = 300
SYSTEM_USAGE = prometheus_client.Gauge('system_usage',
'Hold current system resource usage',
['resource_type'])
if __name__ == '__main__':
@KhepryQuixote
KhepryQuixote / PyTorStemPrivoxy.md
Last active May 19, 2025 07:38
Python script to connect to Tor via Stem and Privoxy, requesting a new connection (hence a new IP as well) as desired.

Crawling Anonymously with Tor in Python

adapted from the article "Crawling anonymously with Tor in Python" by S. Acharya, Nov 2, 2013.

The most common use-case is to be able to hide one's identity using TOR or being able to change identities programmatically, for example when you are crawling a website like Google and you don’t want to be rate-limited or blocked via IP address.

Tor

Install Tor.

@jboner
jboner / latency.txt
Last active May 22, 2025 03:42
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD