Skip to content

Instantly share code, notes, and snippets.

View winterrdog's full-sized avatar
🏠
looking for hard things

winterrdog winterrdog

🏠
looking for hard things
View GitHub Profile
@hantoine
hantoine / download_and_unzip.py
Last active June 28, 2025 14:55
Download and extract a ZIP file in Python
from urllib.request import urlopen
from io import BytesIO
from zipfile import ZipFile
def download_and_unzip(url, extract_to='.'):
http_response = urlopen(url)
zipfile = ZipFile(BytesIO(http_response.read()))
zipfile.extractall(path=extract_to)
@scmx
scmx / using-details-summary-github.md
Last active April 16, 2026 19:37
Using <details> <summary> expandable content on GitHub with Markdown #details #summary #markdown #gfm #html

How to use <details> <summary> expandable content on GitHub with Markdown

Firstly, what is <details> <summary>?

The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

Example

@williewillus
williewillus / gitprimer.md
Last active April 13, 2026 12:20
Git Primer

Git - Quick Primer

A fast-paced introduction to version control and git. If you want the full blown experience, see the git scm book: https://git-scm.com/book/en/v2

What is version control

Version control is maintaining a detailed report of changes that happen to your codebase. Good version control practice allows you to roll back mistakes, work on features in parallel, and combine them into a final product.

How does Git record history?

@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active April 8, 2026 16:32 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
// Djb2 hash function
unsigned long hash(char *str) {
unsigned long hash = 5381;
int c;
while ((c = *str++))
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
return hash % NUM_BUCKETS;
}