Skip to content

Instantly share code, notes, and snippets.

@gatesn
gatesn / aiopa.py
Last active May 11, 2025 16:13
PyArrow and Async IO
from typing import AsyncIterator
import pyarrow as pa
class AsyncMessageReader(AsyncIterator[pa.Message]):
"""Wraps an async iterable of bytes into an async iterable of PyArrow IPC messages.
From this it is possible to build an AsyncRecordBatchStreamReader.
"""
@kauefraga
kauefraga / a-main.py
Last active May 11, 2025 16:04
A oração do programador 🙏
print("""
Código nosso que estás em C
Santificado seja vós, Console
Venha a nós o vosso array[10]
E seja feita, sim, {vossa chave}
Assim no if{} como no else{}
O for (nosso; de cada dia; nos dai hoje++)
Debugai as nossas sentenças
Assim como nós colocamos o ponto e vígula esquecido;
E não nos deixeis errar identação

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@bradtraversy
bradtraversy / docker-help.md
Last active May 11, 2025 15:39
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@larsthegeek
larsthegeek / gist:4029012
Created November 7, 2012 01:38
Update RubyGems to a specific version (for legacy system installs)
How to update RubyGems to a specific version
RubyGems can update itself to the latest version:
gem update --system
However, you always get the newest version. This may be a problem if you’re trying to replicate a known-good environment: for example, the output format of `gem list` in RubyGems 1.3.7 breaks Chef 0.8.16 in certain circumstances. 1.3.6 is fine.
Here’s how to update to a specific version—in this case, 1.3.6:
gem install -v 1.3.6 rubygems-update && \
@vasanthk
vasanthk / System Design.md
Last active May 11, 2025 15:30
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@glubsy
glubsy / howto_record_youtube_livestreams.md
Last active May 11, 2025 15:25
How to properly record Youtube & Twitch live streams

How to record Youtube live streams:

  • use livestream_saver to download from the first segment. Can also record membership-only streams by supplying it your cookies (uses yt-dlp to download)

  • use ytarchive which basically does the same thing, except a bit better.

  • use youtube_stream_capture. You can use cookies file to get member-only streams too. Be aware that this script currently fails to download chunks as soon as the stream has ended (this might be a bug).

  • or use live-dl which does monitoring of streams too. This is a wrapper around streamlink and yt-dlp.

@travyyx
travyyx / Typography.tsx
Created June 19, 2024 22:09
A shadcn ui typography file for heading and paragraphs
import React from 'react';
interface Props {
className?: string;
children: string;
}
const H1: React.FC<Props> = ({className, children}) => {
return (
<h1 className={`scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl ${className}`}>
@SH20RAJ
SH20RAJ / data.php
Created July 27, 2024 16:04
Terabox Downloader PHP Script
<?php
// Get the 'id' from the URL parameters
$id = isset($_GET['id']) ? $_GET['id'] : null;
if ($id) {
// API endpoint for the first request
$apiUrl = "https://terabox.hnn.workers.dev/api/get-info?shorturl={$id}&pwd=";
// Initialize a cURL session for the first request
$ch = curl_init();
#EXTM3U x-tvg-url="https://github.com/MPAndrew/EpgGratis/raw/master/guide.xml.gz"
#EXTM3U x-tvg-url="https://github.com/LITUATUI/M3UPT/raw/main/epg/epg-vodafone.xml.gz"
#EXTM3U x-tvg-url="https://www.tdtchannels.com/epg/TV.xml"
#EXTM3U x-tvg-url="https://raw.githubusercontent.com/vk496/IPTVspain/master/guide.xml"
#EXTM3U x-tvg-url="https://raw.githubusercontent.com/davidmuma/EPG_dobleM/master/guia.xml"
#EXTM3U x-tvg-url="https://github.com/MPAndrew/EpgGratis/blob/master/guide.xml.gz?raw=true"
#EXTM3U x-tvg-url="https://gist.githubusercontent.com/thais0909/2ebcad6ce9e6847df7754b343e13fb75/raw/9374d685fe74ebfc6ea6cefd659cc102f7a94784/guia.txt"
#EXTM3U x-tvg-url="https://gist.githubusercontent.com/micdouglas/486f35eefa2274fa8ec0ce2e3362ec8d/raw/4094cdba37830eacab50c531399aaec0f19ba29b/EPG%2520Tv%2520a%2520Cabo.xml"