Skip to content

Instantly share code, notes, and snippets.

View wilhelmy's full-sized avatar

Moritz Wilhelmy wilhelmy

View GitHub Profile
@holgerschurig
holgerschurig / gist:3817f10540079792e8c225b8d26e59a5
Last active November 3, 2019 16:18
my lsp / clang configuration
;;; Package: lsp-mode - language server protocol
(use-package lsp-mode
:straight t
:diminish lsp-mode ;; I can see if it is active in the menu!
:commands (lsp lsp-deferred)
:hook ((c-mode . lsp-deferred)
(c++-mode . lsp-deferred))
:bind (:map lsp-mode-map
("C-c o" . lsp-describe-thing-at-point)
@ddevault
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
import cv2
import numpy as np
from random import randint, random
intensity = 10
glitch_row_size = 20
img = cv2.imread('/tmp/screenshot.png')
org_rows, org_cols, cnls = img.shape
@thehans
thehans / L_system.scad
Last active April 12, 2024 04:49
L-system implementation in OpenSCAD
/* L-system OpenSCAD library by Hans Loeblich
Version 2.0
- Now supports "M" move without draw
- Also support position save "[" and restore "]"
- Core functions have been completely rewritten and are about twice as fast using half the memory from before.
- Rules now take the form of a single string per rule: "X=ABC"
- Added new examples to demonstrate added features
This library is for creating L-systems, aka Lindenmayer System,
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active May 2, 2024 21:27
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@derhuerst
derhuerst / output.js
Created May 10, 2016 10:22
how fetch a GitHub user's stars
[
{
owner: 'bcoe',
repo: 'top-npm-users',
description: ':star: Generate a list of top npm users by based on monthly downloads.',
language: 'JavaScript',
isFork: false,
stargazers: 27,
watchers: 27
}
@lumbric
lumbric / find_rbl.py
Created April 14, 2016 21:46
Fast draft to get Wiener Linien RBL from address
import lxml
import urllib
import requests
import tabulate
import pandas as pd
# don't ask my why this is distributed via CSV only, not via REST API
csv_params = {
@zonque
zonque / xymodem-mini.c
Last active February 27, 2024 06:31
simple xmodem/ymodem implementation in C
/*
* Minimalistic implementation of the XModem/YModem protocol suite, including
* a compact version of an CRC16 algorithm. The code is just enough to upload
* an image to an MCU that bootstraps itself over an UART.
*
* Copyright (c) 2014 Daniel Mack <github@zonque.org>
*
* License: MIT
*/