- basic source character set (no `$@) translated to universal character name (\u + \U)
- (trigraph sequences)
- <newline> at the end of the line are removed (single pass)
- decomposed into comments and preprocessing tokens:
- header names, identifiers, numbers, literals, etc.
- operators + punctuators
- transformations inside double quotes are reverted
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
interface TaggedHookCallback<T> { | |
type: "hook"; | |
callback: HookCallback<T>; | |
} | |
type FilterCallback<T, U> = (input: T) => Promise<U> | U; | |
interface TaggedFilterCallback<T, U> { | |
type: "filter"; |
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
<script> | |
// MULTIPLE CHOICE BACK TEMPLATE v1.3 {{{ | |
// https://gist.github.com/hgiesel/2e8361afccca5713414a6a4ee66b7ece | |
if (window.Persistence && Persistence.isAvailable() && Persistence.getItem("multipleChoiceSettings")) { | |
var settings = Persistence.getItem("multipleChoiceSettings") | |
var query = settings.query | |
var colors = settings.colors | |
var fieldPadding = settings.fieldPadding |
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
struct point { | |
int x; | |
int y; | |
} | |
void is_between(struct point the_point, struct point a, struct point b) { | |
int cross_product = (the_point.y - b.y) * (a.x - b.x) - (the_point.x - b.x) * (a.y - b.y); | |
if (abs(cross_product) != 0) { | |
return false; |
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
.globl start | |
.cstring | |
str: | |
.asciz "Hello World!\n" | |
str_length: | |
.set str_lngth, .-str | |
.text | |
start: |
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 <iostream> | |
#include <string> | |
class Yen { | |
int _amount; | |
public: | |
Yen(size_t amount): _amount(amount) { /* */ } | |
friend auto operator<< (std::ostream& os, const Yen& yen) -> std::ostream& { |
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 | |
DIR="$(builtin cd "$(dirname "${BASH_SOURCE}" && pwd)" # doesn't actually cd into directory | |
FILE="${DIR}/$(basename "${BASH_SOURCE}")" | |
SYMLINKED_FILE=$(readlink "${FILE}") | |
[[ -n "${SYMLINKED_FILE}" ]] && LIBDIR="$(dirname "${SYMLINKED_FILE}")" || LIBDIR=${DIR} | |
echo "DIR: $DIR" | |
echo "FILE: $FILE" | |
echo "SYMLINKED_FILE: $SYMLINKED_FILE" | |
echo "LIBDIR: $LIBDIR" |