Skip to content

Instantly share code, notes, and snippets.

View ryo33's full-sized avatar

Ryo Hirayama ryo33

View GitHub Profile
@aradarbel10
aradarbel10 / Main.hs
Created December 6, 2022 15:40
A minimalistic example of bidirectional type checking for system F
{-# LANGUAGE StrictData, DerivingVia, OverloadedRecordDot #-}
{-
(compiled with GHC 9.4.2)
-}
{-
HEADS UP
this is an example implementation of a non-trivial type system using bidirectional type checking.
it is...
@jdarcy
jdarcy / activitypub.md
Created November 9, 2022 16:10
Some thoughts about ActivityPub

I've commented a few times about some issues I see with the scalability of ActivityPub - the protocol behind the Fediverse and its best-known implementation Mastodon. A couple of folks have asked for more elaboration, so ... here it is.

First, let me add some disclaimers and warnings. I haven't devoted a lot of time to looking at ActivityPub, so there might be some things I've misunderstood about it. On the other hand, I've brought bigger systems - similar node counts and orders of magnitude more activity per node - from broken to working well based on less study of the protocols involved. So if you want to correct particular misconceptions, that's great. Thank you in advance. If you want to turn this into an appeal to authority and say that I'm wrong only because I haven't developed a full ActivityPub implementation or worked on it for X years ... GTFO.

What

What is ActivityPub? It's an HTTP- and JSON-based protocol for exchanging information about "activities". An activity could be many things.

@tdegrunt
tdegrunt / keyboardLayout.json
Last active April 8, 2024 08:48
Visual Studio Code (vscode/code) Colemak keyboard layout
{
"layout": {
"id": "com.apple.keylayout.Colemak",
"localizedName": "Colemak",
"lang": "en"
},
"rawMapping": {
"KeyA": {
"value": "a",
"valueIsDeadKey": false,
augroup plugin-POWER-mode
autocmd!
autocmd TextChangedI * call s:shake()
autocmd CursorHold,CursorHoldI * call s:restore_pos()
augroup END
set updatetime=100
let s:seed = 0
function! s:rand() abort
@roryokane
roryokane / 1 – myers (default) algorithm.diff
Last active March 25, 2024 03:02
Comparison between Git diff algorithms: myers (default) vs. patience (example favors patience)
diff --git a/file.c b/file.c
index 6faa5a3..e3af329 100644
--- a/file.c
+++ b/file.c
@@ -1,26 +1,25 @@
#include <stdio.h>
-// Frobs foo heartily
-int frobnitz(int foo)
+int fib(int n)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a