Skip to content

Instantly share code, notes, and snippets.

View gforsyth's full-sized avatar
🐗
Cinghiale

Gil Forsyth gforsyth

🐗
Cinghiale
View GitHub Profile
@munificent
munificent / generate.c
Last active May 14, 2024 05:30
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
@kylebrandt
kylebrandt / i3hangout.md
Last active June 27, 2023 15:50
i3 Hangout / Meet VLC screensharing workaround mutli-monitor

Share an area of your screen by using vlc screen capture, and then sharing the vlc capture window

Make sure the VLC window floats

In i3 config:

for_window [window_role="vlc-video"] floating enable move down 100px;

We float it so the tiling window manager doesn't resize the window and mess up the scale. We also move the window placement down at launch so it easy to drag somewhere mostly offscreen.

@teoliphant
teoliphant / rolling.py
Last active October 23, 2019 19:54
Create a function to make a "sliding_window" output array from an input array and a rolling_window size.
import numpy as np
def array_for_sliding_window(x, wshape):
"""Build a sliding-window representation of x.
The last dimension(s) of the output array contain the data of
the specific window. The number of dimensions in the output is
twice that of the input.
Parameters
from sre_parse import Pattern, SubPattern, parse as sre_parse
from sre_compile import compile as sre_compile
from sre_constants import BRANCH, SUBPATTERN
class Scanner(object):
def __init__(self, tokens, flags=0):
subpatterns = []
pat = Pattern()