This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://saveandrun.com/posts/2020-04-05-querying-pacman-with-datalog.html | |
import code | |
import re | |
import subprocess | |
from itertools import starmap | |
from operator import add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/make -f | |
# vim:ft=make | |
# https://saveandrun.com/posts/2019-06-27-makefile-madness.html | |
EXT_UUID = fe3bf9b3-90f9-485c-ba22-5400d8be85c8 | |
EXT_DIR = $(shell findmnt -S UUID=$(EXT_UUID) | tail -1 | cut -f1 -d' ') | |
CLIPBOARD := $(shell xclip -selection clipboard -o) | |
TERMINAL := kitty | |
RSYNCFLAGS=--human-readable --verbose --archive --update --compress --ignore-existing --exclude-from=/home/kaj/.rexclude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ranger.api.commands import Command | |
# https://saveandrun.com/posts/2019-05-07-writing-a-command-for-ranger.html | |
class bspace(Command): | |
""":bspace [command sequence] | |
Temporarily bind a command to the space bar. {file} is | |
replaced with the currently selected item and {cwd} with | |
the current working directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
color text from stdin based on user specified regular expressions | |
usage: | |
command | rcolor.py -p 'regex1' 'regex2' ... 'regexn' | |
""" | |
# https://saveandrun.com/posts/2019-03-24-coloring-arbitrary-shell-output.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Check the readme for details */ | |
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <string.h> | |
/* Constants */ | |
#define END 0b1111UL | |
#define TERMS 9 /* Number of terms in a single chromosome */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import re | |
OPERATORS = ['+', '-', '/', '*', '(', ')'] | |
""" | |
Math expression parser and evaluater as explained in | |
https://lukaszwrobel.pl/blog/math-parser-part-1-introduction/ | |
Expressions are broken up as follows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2 | |
import sys | |
import pygame | |
from pygame.locals import * | |
import itertools | |
import math | |
pygame.init() | |
pygame.font.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from bs4 import BeautifulSoup | |
import requests | |
import pprint | |
import re | |
import sys | |
import yaml | |
base_url="https://www.top500.org/list/2017/06/?page=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |
""" | |
Gets a list of names based on the year of birth from wikipedia | |
categories. |