Skip to content

Instantly share code, notes, and snippets.

View steakhal's full-sized avatar

Balazs Benics steakhal

View GitHub Profile
@steakhal
steakhal / stack.ll
Created January 29, 2020 16:20 — forked from barrucadu/stack.ll
Stack implementation in LLVM IR
; The stack pointer is going to be an index into the stack, and the
; stack is an array of words. The alternative would be to have the
; stack pointer me a pointer to memory, but this is perhaps a bit
; nicer, as where the stack actually lives is totally irrelevant.
@stack = global [1000 x i64] undef
@sp = global i64 undef;
; Now we have the basic stack operations: push, pop, and peek. As can
; be seen from the definitions, LLVM is typed, which is really nice as
@steakhal
steakhal / ubuntu-switch-input-method.sh
Last active May 22, 2019 10:44
ubuntu-switch-input-method
# from: https://askubuntu.com/a/986629
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Control>space']"
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Alt>space']"
gsettings reset org.gnome.desktop.wm.keybindings switch-input-source
gsettings reset org.gnome.desktop.wm.keybindings switch-input-source-backward
# from http://apt.llvm.org/
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
# put this into: /etc/apt/sources.list
# eg. Bionic (18.04) but only for X86_64
codename=$(lsb_release -c --short)
deb "http://apt.llvm.org/$codename/" "llvm-toolchain-$codename" main
# deb-src "http://apt.llvm.org/$codename/" "llvm-toolchain-$codename" main