Skip to content

Instantly share code, notes, and snippets.

@GuillaumeDesforges
GuillaumeDesforges / obj.txt
Last active April 16, 2024 02:29
Writing an ELF file manually
# This file `obj.txt` is a hexdump with comments to manually build an ELF file.
# Lines starting with '#' are comments.
# The rest is read as per `xxd -r -p` (see `man xxd`)
# You can build the binary executable `obj.elf` using the command:
# ```bash
# <obj.txt grep -v '^#' | xxd -r -p >obj.elf
# ```
# You can then use chmod to make `obj.elf` executable.
# ==================
@jhburns
jhburns / razz_lang.hs
Last active April 29, 2024 18:48
Small RPN calculator
-- razz_lang
import Data.Function
import Data.Semigroup
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Text.Read as Read
-- Stack types
@brendanzab
brendanzab / ArithExprs.lean
Last active September 22, 2021 09:38
A proof of the correctness of an arithmetic expression compiler and decompiler in Lean 4.
/-
A proof of the correctness of an arithmetic expression compiler in Lean 4.
Ported from [expcompile.v], which is part of Derek Dreyer and Gert Smolka's
[course material].
[expcompile.v]: https://www.ps.uni-saarland.de/courses/sem-ws17/expcompile.v
[course material]: https://courses.ps.uni-saarland.de/sem_ws1718/3/Resources
-/
@brendanzab
brendanzab / ddl-experiment.makam
Last active May 11, 2020 05:30
A dependently typed binary data description language, prototyped in Makam!
% Copyright 2020 YesLogic Pty. Ltd.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
@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
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 17, 2024 15:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname