Skip to content

Instantly share code, notes, and snippets.

View redaready's full-sized avatar
😀

redaready redaready

😀
  • Aix en provence, France <-> Tokyo, Japan
View GitHub Profile
@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@lobre
lobre / zig_type_system.md
Last active December 3, 2025 12:41
Zig type system illustrated using ascii diagrams

Zig Type System

Zig aims to be a simple language. It is not easy to define what simple exactly means, but zig is also a low-level programming language that aims for c-compatibility. To reach this goal, it needs good semantics in its type system so that developers have a complete toolbox to manipulate data.

So types in zig are composable, but this can become rapidly overwhelming. See those examples. Are you able to understand them at a glance, as soon as you read them?

*const ?u8
?*const u8
*const [2]u8
@tylermorganwall
tylermorganwall / submarine_cable_map.R
Last active December 17, 2025 09:14
Submarine Cable Map Dataviz
library(geojsonsf)
library(sf)
library(rayrender)
#Data source: https://github.com/telegeography/www.submarinecablemap.com
cables = geojson_sf("cable-geo.json")
cablescene = list()
counter = 1
for(i in 1:length(cables$geometry)) {
@bentrengrove
bentrengrove / MatrixText.kt
Last active December 5, 2024 22:24
MatrixText.kt - A Composeable that displays text Matrix style down the screen
private const val MAX_SPEED = 25
private const val MIN_SPEED = 7
private const val MAX_FONT_SIZE = 64f
private const val MIN_FONT_SIZE = 24f
private val characters = listOf("ジ", "ェ", "ッ", "ト", "パ", "ッ", "ク", "構", "成")
private val colors = listOf(0xffcefbe4, 0xff81ec72, 0xff5cd646, 0xff54d13c, 0xff4ccc32, 0xff43c728)
@Composable
fun MatrixText(
stripCount: Int = 25,
lettersPerStrip: Int = 20,
@DavidColby
DavidColby / slider.html
Created May 6, 2021 22:12
Implementation of a horizontal slider component with Stimulus and Tailwind CSS
<!--
This code is meant to accompany the guide originally published at https://colby.so/posts/building-a-horizontal-slider-with-stimulus-and-tailwind
It intentionally pulls in Tailwind CSS and Stimulus without a build system to simplify the guide. You shouldn't do this with a real application,
you should use a build system like webpack!
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@ExperimentalCoroutinesApi
@Composable
fun loadPicture(url: String, @DrawableRes defaultImage: Int): MutableState<Bitmap?> {
val bitmapState: MutableState<Bitmap?> = mutableStateOf(null)
// show default image while image loads
Glide.with(ContextAmbient.current)
.asBitmap()
.load(defaultImage)
@rxwei
rxwei / ad-manifesto.md
Last active December 6, 2024 16:54
First-Class Automatic Differentiation in Swift: A Manifesto
@nvbn
nvbn / find.py
Created July 9, 2018 22:23
trip planner
import json
from datetime import date, datetime, timedelta
from collections import defaultdict, namedtuple
from multiprocessing import Pool, cpu_count
import csv
from operator import itemgetter
from heapq import merge
from itertools import islice
from dateutil.parser import parse
@steven2358
steven2358 / ffmpeg.md
Last active December 25, 2025 16:52
FFmpeg cheat sheet
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active November 23, 2025 22:45 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from