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
# launch scratchpad frame in existing emacs daemon | |
exec --no-startup-id /usr/local/bin/pad.sh | |
# when scratchpad frame is launched, move it to the scratchpad workspace | |
for_window [title="_emacs scratchpad_" class="Emacs"] move scratchpad |
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 -x | |
rm -f *.o redefine | |
CC=clang-9 | |
LD=$CC | |
CFLAGS="-fno-inline-functions -O0" | |
$CC -c redefine.c -o redefine.o $CFLAGS | |
$CC -c redefine_b.c -o redefine_b.o $CFLAGS |
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 -x | |
rm -f *.o weak | |
CC=clang-9 | |
LD=$CC | |
CFLAGS="-fno-inline-functions -O0" | |
$CC -c weak.c -o weak.o $CFLAGS | |
$CC -c weak_b.c -o weak_b.o $CFLAGS |
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 -x | |
CC=clang-9 | |
rm -f *.o wrap nowrap | |
# build without wrapping | |
$CC -c wrap.c -o wrap.o | |
$CC -c wrap_b.c -o wrap_b.o | |
$CC wrap.o wrap_b.o -o nowrap |
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
/* ftg_core.h - v0.5 - Frogtoss Toolbox. Public domain-like license below. | |
ftg libraries are copyright (C) 2015 Frogtoss Games, Inc. | |
http://github.com/mlabbe/ftg_toolbox | |
ftg header files are single file header files intended to be useful | |
in C/C++. ftg_core contains generally useful functions | |
Special thanks to STB for the inspiration. |
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
dev = true | |
ent_list = {} | |
types = {} | |
cam={0,0} -- world top-left | |
-- | |
-- helpers | |
-- | |
function get_player(n) |
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 | |
# | |
# Roaming security group by Michael Labbe | |
# @frogtoss | |
# | |
# security group id | |
GROUP_ID="sg-xxx" |
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
(use-package cc-mode | |
:defer t | |
:init | |
(add-hook 'before-save-hook #'clang-format-buffer-smart) | |
:config | |
(progn | |
(defun clang-format-buffer-smart() | |
"Reformat buffer only if .clang-format exists in the projectile root." | |
(when (file-exists-p (expand-file-name ".clang-format" (projectile-project-root))) | |
(clang-format-buffer))) |
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
/* | |
simple rust calculator | |
add_op := '+' | '-' | |
mul_op := '*' | '/' | |
digits := {'+' | '-'} [0..9] {[0..9]} | |
expr := term {add_op term} | |
term := factor {mul_op factor} | |
factor := digits | '(' expr ')' |
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
typedef union { | |
struct tuple_s { char a; short b; long long c; }tuple; | |
uint64_t _all[sizeof(struct tuple_s)/sizeof(uint64_t)]; | |
}zero_tuple_u; | |
int main() { | |
zero_tuple_u t = {._all = {0}}; | |
} |