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
\\ An Evolution Game | |
\\ | |
\\ Implemented by @promovicz on 2023-11-25. | |
\\ | |
\\ Inspired by Martin Escardo on Mastodon: | |
\\ https://mathstodon.xyz/@MartinEscardo/111467732542708261 | |
\\ | |
\\ Count derangements in world $x$ | |
derangements(x) = sum(i=1,#x,x[i]!=i) |
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
.account__header__fields { | |
padding: 0.2em 0.3em; | |
} | |
.account__header__fields dl { | |
width: 100%; | |
overflow: hidden; | |
padding: 0.1em; | |
margin: 0 | |
} | |
.account__header__fields dl dt { |
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
/* Hide navigation bar logo */ | |
.navigation-panel__logo { | |
display: none; | |
} | |
/* Hide header logo */ | |
.ui__header__logo svg { | |
display: none; | |
} | |
/* Toot button */ | |
.ui__header__links > .button[href="/publish"], |
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/python3 | |
# spontaneously smashed together by @[email protected] | |
# in response to a question by @[email protected] | |
from argparse import ArgumentParser | |
from mastodon import Mastodon | |
ap = ArgumentParser('unsuspend') | |
ap.add_argument('-i',type=str,help='instance',default='chaos.social') |
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
// This little program uses a SIGSEGV handler to auto-map pages as they are used. | |
// If you want you can use this to program without a memory allocator. | |
// gcc -std=c11 -Wall -Wextra -g -o allmem allmem.c /usr/lib/x86_64-linux-gnu/libsigsegv.a | |
#define _GNU_SOURCE 1 | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <limits.h> | |
#include <pthread.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
Example use: | |
# qubes control | |
bindsym $mod+u exec --no-startup-id "qubes-i3-dmenu-shell --start" | |
bindsym $mod+Shift+u exec --no-startup-id "qubes-i3-dmenu-shell --pause" | |
bindsym $mod+i exec --no-startup-id "qubes-i3-dmenu-shell --shutdown" | |
bindsym $mod+Shift+i exec --no-startup-id "qubes-i3-dmenu-shell --unpause" | |
# qubes launching | |
bindsym $mod+o exec --no-startup-id "qubes-i3-dmenu-shell --global" |
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 <errno.h> | |
#include <locale.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <wchar.h> | |
#include <unistd.h> | |
int main(int argc, char **argv) { | |
int res, i; | |
char buf[64]; |
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 | |
# qvm-restart <domain> | |
# | |
# Restart the given Qubes DOMAIN, reattaching | |
# all its network dependents as needed. | |
# | |
set -e |
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 | |
# qubes.GetHostsFile - RPC service for retrieving a hosts file | |
# | |
# This will emit a hosts file containing the addresses of all qubes | |
# directly connected to the qube calling the service. | |
# | |
# It can be used in firewall VMs to get name resolution for these VMs. | |
# | |
# Note that using this script might create an information leak. |
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 <stdlib.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) { | |
unsigned word; | |
int count; | |
/* check for argument */ | |
if(argc < 2) { printf("Usage: %s INTEGER\n", argv[0]); abort(); } | |
/* convert argument */ | |
word = (unsigned)atoi(argv[1]); | |
/* count number of 1-bits */ |
NewerOlder