Skip to content

Instantly share code, notes, and snippets.

@danielchasehooper
danielchasehooper / inline_shader.js
Created February 4, 2025 20:33
the code that creates the interactive shader editor for danielchasehooper.com
"use strict";
// I'm posting at the request of this lobsters comment: https://lobste.rs/s/ycbpnz/animating_rick_morty_one_pixel_at_time#c_wonfh3
// this code sets up the live shader editor on http://danielchasehooper.com/posts/code-animated-rick/
(function() {
let gl;
let program;
let cached_vertex_shader;
@egeozcan
egeozcan / index.html
Created October 18, 2024 08:40
image viewer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fullscreen Image Viewer</title>
<style>
body {
font-family: Arial, sans-serif;
}
@eskfung
eskfung / snacklog.md
Created September 24, 2024 19:11
In Support of the “Snacklog”

Recently we’ve noticed a number of our clients maintain a backlog of small tasks that are handled separately from their main backlog. These are tasks that should be finished at some point, but will rarely take priority over business-critical features and bugfixes. Often they are bite-sized pieces of work that can be finished in a couple of hours or less: addressing engineering chores, paying off tech debt, and addressing minor bugs. Internally, this separate backlog has earned a catchy name: the snacklog.

When is it appropriate to work on a snacklog task instead of something in the prioritized backlog? After all, developers should be working on things that move the business forward (obviously). Inevitably, though, natural lulls come up in the course of development:

  1. I’ve just finished a big pull request and have some time before my team finishes leaving feedback.
  2. I’m temporarily blocked by a design or product decision.
  3. It’s near the end of the day, and I’d rather work on something small than sta
@natanlao
natanlao / syncthing-photo-sync.md
Last active February 23, 2025 18:47
Syncing iPhone photos with Syncthing

For those who prefer to avoid solutions like iCloud Photos and Dropbox for backing up photos, you can sync your iPhone photos with Syncthing. To do this, you'll need two things:

  • Möbius Sync is, to my knowledge, the only actively-maintained Syncthing client for iOS. It's free to sync up to 20 MB, and only $4.99 (one-time) to remove that limit.

  • PhotoSync is a nifty iOS app for syncing photos to a number of different destinations. It's free for low-quality

@johnwcowan
johnwcowan / dioscuri.md
Last active January 17, 2021 21:36
Dioscuri, a Gemini-adjacent protocol for interaction

This gist will be maintained, and supersedes all IRC and email description of Dioscuri.

Dioscuri, a Gemini-adjacent protocol for interaction

Dioscuri is a protocol intended to supplement Gemini for doing things like performing remote actions or running an application server. It is the POST to Gemini's GET. Dioscuri servers will run on a different port from Gemini servers, so that they do not interfere with each other; it will often be useful to run multiple servers on one host, so no fixed port is specified. The use of client certificates for authorization is strongly recommended, especially if requests are interpreted to affect server-side state.

The name "Dioscuri" is the Latin version of the Classical Greek name Διόσκουροι for the Heavenly Twins, Castor and Pollux/Polydeukes, who were called Gemini in Latin; the constellation is named after them. I say dee-OH-skoo-ree, but Greeks, classicists, and others should feel free to pronounce the name their way.

Great thanks to the members of [#gemini](ir

# downloads a page from gemini server
(echo "gemini://gemini.circumlunar.space/docs/"; sleep 1) | openssl s_client -connect gemini.circumlunar.space:1965
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active July 6, 2025 20:56
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@munificent
munificent / generate.c
Last active July 4, 2025 13:39
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@fnky
fnky / ANSI.md
Last active July 4, 2025 11:03
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27