Skip to content

Instantly share code, notes, and snippets.

@ryo
ryo / aarch64-cond.txt
Created February 15, 2018 05:16
aarch64 condition code cheat sheet
meaning cmp A, B sign flags
------------------------------- ------- --------------- --------------- -------------------
equal eq A == B - Z == 1
not equal ne A != B - Z == 0
carry set cs,hs A >= B unsigned C == 1
carry clear cc,lo A < B unsigned C == 0
higher hi A > B unsigned C == 1 && Z == 0
lower or same ls A <= B unsigned !(C == 1 && Z == 0)
@kpym
kpym / tkz-euclid-cheatsheet.en.md
Last active March 5, 2026 15:33
cheatsheet : tkz-euclid (latex library based on tikz)

Gist

Package

\usepackage{tkz-euclide} % checked for version 3.02c

Point definitions

@aaronryank
aaronryank / c-lambda.bash
Last active May 29, 2024 23:09
Convert a C function to a lambda via executable strings.
#!/usr/bin/env bash
read -p "Function return type: " val
if [ "$1" != "mini" ]; then
read -p "Function name: " name
fi
read -p "Function argument list: " list
echo "$val $name($list) {" >f.c
echo "Enter code:"
@eduncan911
eduncan911 / Revert-Gist.md
Last active June 20, 2025 23:11
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone git@github.com:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.

@manasthakur
manasthakur / plugins.md
Last active March 12, 2026 17:45
Managing plugins in Vim

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim
@lbn
lbn / matprint.py
Created November 7, 2015 12:32
Pretty print a matrix in Python 3 with numpy
def matprint(mat, fmt="g"):
col_maxes = [max([len(("{:"+fmt+"}").format(x)) for x in col]) for col in mat.T]
for x in mat:
for i, y in enumerate(x):
print(("{:"+str(col_maxes[i])+fmt+"}").format(y), end=" ")
print("")
# Try it!
import numpy as np
anonymous
anonymous / fish.py
Created August 30, 2013 17:41
><> python interpreter.
#!/usr/local/bin/python3.2
"""
Python interpreter for the esoteric language ><> (pronounced /ˈfɪʃ/).
Usage: ./fish.py --help
More information: http://esolangs.org/wiki/Fish
Requires python 2.7/3.2 or higher.