This file contains hidden or 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
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <pthread.h> | |
// see https://github.com/imneme/pcg-c | |
#include "pcg_variants.h" |
This file contains hidden or 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
#!/bin/bash | |
# XXX not my work, just keeping it here for everyone to see, -fritschy | |
# Based in part on https://wincent.com/wiki/Fixing_the_baseline_on_the_Consolas_font_on_OS_X | |
function fail() | |
{ | |
local error=${1:-Unknown error} | |
echo "Failed! $error" | |
exit 1 |
This file contains hidden or 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
#!/bin/sh | |
set -eu | |
tpid=0 | |
for id in $(xinput list --id-only) | |
do | |
if xinput list-props $id | grep -q "^Device 'SynPS/2 Synaptics TouchPad':" | |
then |
This file contains hidden or 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
#!/bin/sh | |
c=$1 | |
max=$2 | |
title="" | |
set -eu | |
[ "$c" = "" ] && exit 1 | |
[ "$max" = "" ] && max=100 || { shift 2; title="$@ "; } |
This file contains hidden or 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 | |
# coding=UTF-8 | |
from os import system, cpu_count, getpid | |
from os.path import isfile, split, splitext, join | |
from sys import argv, exit, stderr | |
from re import sub | |
from subprocess import call | |
from multiprocessing import Pool | |
from traceback import print_exc |
This file contains hidden or 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
#!/bin/sh | |
S="$1" | |
set -eu | |
I=$(xdpyinfo | grep focus:\ | cut -d\ -f4) | |
P=$(xprop -id $I | grep -m 1 _NET_WM_PID | cut -d\ -f3) | |
kill $S $P |
This file contains hidden or 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
#ifndef FULLERENE_HPP | |
#define FULLERENE_HPP | |
#include <float.h> | |
#include <inttypes.h> | |
#include <stddef.h> | |
#include <graphene.h> | |
namespace C { |
This file contains hidden or 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
# set following sysctl settings in /boot/loader.conf | |
kern.ipc.shmseg=1024 | |
kern.ipc.shmmni=1024 | |
# (that is in addition to the instmsg setting) | |
# source: https://forums.freebsd.org/threads/36809/#post-206410 |
This file contains hidden or 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
#!/bin/busybox sh | |
set -eu | |
# reset | |
export LD_LIBRARY_PATH= | |
# call mpc once | |
STATUS=$(mpc|tr -s ' ') | |
FIRST=$(echo "$STATUS" | head -n1) |