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 bash | |
word_max=9 # Exclude words longer than this | |
nphrases=3 # Generate this many passphrases | |
defwords=4 # Default number of words/phrase | |
pls() { | |
local -i n=${#1} r=$2 | |
local s | |
printf -v s -- ' %s%*s%s\n' \ |
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
#include <stdio.h> | |
enum { | |
FOO = 1 << 0, | |
BAR = 1 << 1, | |
BYX = 1 << 2, | |
QUE = 1 << 3 | |
}; | |
#define maybe_signed(T, cond) __typeof__( \ |
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
#include <stdio.h> | |
#define sizeof(x) (!(#x[0]^0x27)?:sizeof(x)) | |
#define q(x) printf("%-7s\t%zu\n", #x, x) | |
#define p(x) q(sizeof(x)) | |
int main (void) | |
{ | |
char s[7], c; |
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
#include <stdio.h> | |
#define ___ putchar | |
#define __ sizeof | |
#define _ __func__ | |
int main( | |
void | |
){___(*(_+((*_>>(__(__(_))>> | |
4))&(*_>>__(_)))));___(*(_+((*_>>(__(__(_))>> | |
2))&(*_>>__(_)))));___(*(_+((*_>>(__(__(_))>> | |
1))&(*_>>__(_)))));___(*(_+((*_>>(__(__(_))>> |
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
/*----------------------------* | |
| s p o o k y m e s s a g e | | |
*----------------------------*/ | |
#include <stdio.h> | |
#include <string.h> | |
__typeof__(~ | |
sizeof("{%s, n%s}\n")) main | |
( __typeof__(~* | |
"")eof__, | |
__typeof__(* |
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
#include <cstdio> | |
int main() { | |
constexpr auto tautology{1ull << 63}; | |
if (tautology) | |
std::puts("raw value evaluates to true"); | |
if (static_cast<bool>(tautology)) | |
std::puts("bool conversion equals true"); |
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/bash | |
printf '%s\n' "int main(void) { puts(strchr(__FILE__, '#') ?: __FILE__); }" > './#include' | |
printf '#include <%s>\n' 'stdio.h' 'string.h' '#include' | cc -I. -o./includeinclude -xc - | |
./includeinclude |
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
static const char *const SOURCE=(const char[]){ | |
#embed __FILE__ | |
,0}+72; | |
#include <stdio.h> | |
int main() { | |
puts(SOURCE); | |
} |
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/bash | |
#; / / #; | |
#; / / #; | |
#; / / #; | |
#;/ / #; | |
#; / #; | |
#; / ; ; ; ; #; | |
#; / ####### #; | |
#;/ ## C ## #; | |
#; ;#####; #; |
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
#include <errno.h> | |
#include <limits.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define stringify_(x) #x | |
#define stringify(x) stringify_(x) |