Skip to content

Instantly share code, notes, and snippets.

@rebane2001
rebane2001 / glass-with-controls.html
Last active July 10, 2025 05:34
glass effect test css/svg thing (messy) - demo: https://codepen.io/rebane2001/details/OPVQXMv
<div style="position:absolute;top:-999px;left:-999px">
<svg
id="effectSvg"
width="200"
height="200"
viewBox="0 0 200 200"
xmlns="http://www.w3.org/2000/svg">
<filter id="displacementFilter4">
@ShadowJonathan
ShadowJonathan / haproxy.cfg
Last active April 3, 2024 19:08
A reverse proxy daisy chain config that buffers fediverse traffic
# Place this after your default configuration
frontend fedi_fe
mode http
# this is the address that haproxy will listen on,
# when doing this local loopback, its recommended to set to localhost (127.0.0.1)
bind 127.0.0.1:28080
default_backend fedi_fe
@drewolbrich
drewolbrich / View+WindowGeometryPreferences.swift
Last active May 9, 2025 22:53
A visionOS SwiftUI view modifier that can be used to hide a window's resize handles or to constrain a window's aspect ratio
//
// View+WindowGeometryPreferences.swift
//
// Created by Drew Olbrich on 1/30/24.
// Copyright © 2024 Lunar Skydiving LLC. All rights reserved.
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

A funky shell thingy that I've never seen before

So you're in posix sh and you want to do the equivalent of this in bash:

foo | tee >(bar) >(baz) >/dev/null

(Suppose that bar and baz don't produce output. Add redirections where needed if that's not the case.)

@karpathy
karpathy / stablediffusionwalk.py
Last active July 11, 2025 07:21
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@jdarpinian
jdarpinian / executable.c
Last active April 2, 2025 15:41
Add one line to your C/C++ source to make it executable.
///$(which true);FLAGS="-g -Wall -Wextra --std=c17 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $FLAGS "$THIS_FILE" -o "$OUT_FILE" || exit $?;exec bash -c "exec -a \"$0\" \"$OUT_FILE\" $([ $# -eq 0 ] || printf ' "%s"' "$@")"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
{ stdenv, pkgconfig, cmake, bluez, ffmpeg, libao, gtk2, glib, mesa
, gettext, libpthreadstubs, libXrandr, libXext, readline, openal
, libXdmcp, portaudio, fetchzip, fetchFromGitHub, libusb, libevdev
, wxGTK30, soundtouch, miniupnpc, mbedtls, curl, lzo, sfml
, libpulseaudio ? null }:
stdenv.mkDerivation rec {
name = "dolphin-emu-faster-melee-beta-${version}";
version = "5.8.7";
anonymous
anonymous / playground.rs
Created November 30, 2017 15:36
Rust code shared from the playground
pub struct Convex<T: AsRef<[Point]> + ?Sized> {
vertices: T
}
pub struct Point(f32, f32);
impl<T: AsRef<[Point]>> Convex<T> {
pub fn new(vertices: T) -> Option<Convex<T>> {
fn is_polygon_convex(_: &[Point]) -> bool { true }
let is_convex = {
@taktoa
taktoa / keybase.nix
Created November 22, 2017 20:21
Getting the Keybase GUI to work on NixOS
# Add this file to your /etc/nixos/configuration.nix `imports = [ ... ];` attribute.
#
# After running `nixos-rebuild switch`, `systemctl --user start keybase-gui.service`
# can be used to start the Keybase GUI.
#
# Not sure if it's just my tiling window manager, but there is a bit of wonkiness
# with the tray icon. Other than that it works perfectly (as of 2017/11/22).
{ pkgs, ... }:
@greglearns
greglearns / default.nix
Last active February 13, 2019 20:39
NixOS default.nix for compiling Nightly Rust using Mozilla overlay, also with a specific RustRegistry for specific date, to handle "version not found" issues. Doesn't actually work, so do not use.
{
pkgs ? (
let
pkgs = import <nixpkgs>;
pkgs_ = (pkgs {});
rustOverlay = (pkgs_.fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
rev = "1608d31f7e5b2415fb80b5d76f97c009507bc45f";
sha256 = "0mznf82k7bxpjyvigxvvwpmi6gvg3b30l58z36x192q2xxv47v1k";