Skip to content

Instantly share code, notes, and snippets.

Lifted from https://github.com/Lend27/linuxstuff/blob/master/debfontsmoothing
Create a file called .fonts.conf in your home directory, and put the following contents in it:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "<relevant 'deb http://...' text from https://apt.llvm.org>"
sudo apt update
sudo apt install clang-<latest-version>
sudo apt install libclang-<latest-version>-dev
# may need to install llvm-<latest-version>, llvm-<latest-version>-runtime

Also may have to fix what llvm-config points to. Do this.

How to import locally-made libs in Python

NOTE likely not completely accurate (will update at some point – short on time atm.)

You will want to have a shell wrapper script that containts the following. Where /path/to/script is the path too your python script(s)

#!/usr/bin/env bash
export PYTHONPATH=$PYTHONPATH:/path/to/script
@jstaursky
jstaursky / od-vs-hexdump.org
Last active July 23, 2020 19:11
hexdump vs od

Equivalent expressions in od and hexdump

interpret next 4 bytes as a signed decimal

od -t d4

format the next 4 bytes as a 4 byte decimal

hexdump  -e '/4 " %d"'
(use-package rtags
  ;; Note that if you recompile and create new compile_commands.json
  ;; you will need to run "rc -J ." for rtags to reflect the changes.
  ;; REMEMBER RTAGS DOES NOT WORK FOR PROJECTS INSIDE /tmp
  :init
  (add-hook  'c++-mode-hook  #'rtags-start-process-unless-running)
  (add-hook  'c-mode-hook    #'rtags-start-process-unless-running)
  (add-hook 'rtags-jump-hook 'evil-set-jump)
# This is David A. Wheeler's template for configure.ac, showing
# taken from https://dwheeler.com/autotools/
# some suggested options and setups.
# Process this file with autoconf to produce a configure script.
# Initialize autoconf.
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS],
[TAR-NAME], [URL])
# Force autoconf to be at least this version number:
@jstaursky
jstaursky / slaspec.org
Last active August 13, 2020 15:29
learning to write slaspec
define endian=big;
define  space     ram       type=ram_space       size=4   default;
define  space     register  type=register_space  size=4;
define  register  offset=0  size=1 [ r0 r1 ];

define token instr(8)
op=(0,0) reg=(1,1) mode=(2,2) imm=(3,3)
;
attach variables [ reg ] [ r0 r1 ];
@jstaursky
jstaursky / minimal-emacs-conf.org
Last active November 13, 2020 03:11
minimal emacs, .emacs, init.el, beginner

Minimal .emacs/init.el

Sets up clean organization inside user-emacs-directory with a separate custom.el file, a backup directory and a settings.org file for a more literate emacs configuration that can be built upon.

Note that you may need to ”touch” some of the initial files so no error appears on startup.

;; do not use `init.el` for `custom-*` code - use `custom-file.el`.
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))

(when (file-exists-p custom-file)
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "stdint.h"
void print_bits(uintmax_t number)
{
unsigned char* output = calloc (8*sizeof (uintmax_t), 1);
unsigned char* mov = output;

Emacs isn't just an editor, it’s an entire Emacs Lisp interpreter and environment. We can use Emacs Lisp not only to extend and customize our beloved editor, but also to write entire programs and applications. Nic Ferrier’s [elnode][] server is the most ambitious Emacs Lisp application of this sort, but we can start at a smaller scale and try to write our shell scripts and tools with Emacs Lisp.

However, it turns out that writing programs in Emacs Lisp is more intricate than it looks at a first glance. Emacs decades-long history as interactive application have left deep marks in Emacs and Emacs Lisp, which make independent