-
Set and export shell variables
Use a helper variable for the prefix name:
MYPREFIX=cudatest
/* If you compile with clang and `-Weverything' you'll probably want | |
* to use `-Wno-gnu-statement-expression-from-macro-expansion', too. | |
* | |
* Plain C18 version: | |
* https://gist.github.com/imaami/92b38f45142f8a8390fefa2d972bc63d | |
*/ | |
#define typeof_unqual(x) __typeof__(({ *(__typeof__(x) *)(void *)0; })) | |
int main(void) | |
{ |
#include <stdatomic.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#define TRANSACTION(name, ptr, lock, expect, desire) \ | |
struct { \ | |
union { \ | |
atomic_ulong *state; \ | |
struct { \ | |
char lock_bit[(lock)]; \ |
#include <errno.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct str { | |
union { | |
char *ptr; |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct U { | |
union { | |
unsigned long long i; | |
char s[sizeof(unsigned long long)]; | |
}; |
/** | |
* @brief I Made a POSIX Semaphore Wrapper and I'm So Sorry | |
* | |
* Compile with -std=c++20 or later. Usage: | |
* | |
* auto *sem = new named_sem<"/name", O_CREAT | O_RDWR, 0666, 0>(); | |
* if (sem) { | |
* sem->post(); | |
* delete sem; | |
* } |
#!/bin/bash | |
set_git_configs() | |
{ | |
git config --global pull.ff only | |
} | |
set_git_aliases() | |
{ | |
local -A ALIAS name |
Xcursor.size: 24 | |
Xft.antialias: true | |
Xft.rgba: none | |
Xft.hinting: true | |
Xft.autohint: true | |
Xft.hintstyle: full | |
! black | |
URxvt*color0: #000000 | |
URxvt*color8: #686868 |
#!/bin/false | |
# | |
# This file exists because i3 really sucks at starting dmenu_run. | |
# | |
# Very often when I type mod4+d followed by "steam" and an enter keypress | |
# the first letter gets dropped (I assume because dmenu_run hasn't captured | |
# the keyboard yet). What ends up happening is that dmenu_run sees "team" | |
# and automatically finds the closest match which happens to be "teams". | |
# | |
# I almost never fucking want to launch Microsoft Teams, but I launch the |