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
| #pragma once | |
| // config | |
| #define LOG_USE_STDIO 1 | |
| #define LOG_USE_FILE 0 | |
| #define LOG_USE_STRUCTURED 1 | |
| #define LOG_LEVEL_TRACE 0 | |
| #define LOG_LEVEL_WARN 1 | |
| #define LOG_LEVEL_ERROR 2 |
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/env python3 | |
| # parse log.h's structured format: | |
| # | |
| # - each line ends with sequence 0x20 0x1a 0x0a | |
| # - must parse through possible ascii escape sequences | |
| # - 0x1b (esc) until 'm' | |
| # - structure starts with line containing 3 upcase alpha chars | |
| # - message ends with 0x1a 0x1a 0x0a | |
| # - each line after the first is 0x09 |
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
| # put in /etc/dnsmask.d and restart the daemon | |
| # then run ipconfig /flushdns | |
| # | |
| # run at your own risk | |
| address=/windowsupdate.microsoft.com/0.0.0.0 | |
| address=/update.microsoft.com/0.0.0.0 | |
| address=/windowsupdate.com/0.0.0.0 | |
| address=/test.stats.update.microsoft.com/0.0.0.0 | |
| address=/ntservicepack.microsoft.com/0.0.0.0 | |
| address=/download.microsoft.com/0.0.0.0 |
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 | |
| clang hello.c -target arm64-apple-darwin20.1.0 -o hello.arm64 | |
| echo -n "hello.arm64 is architecture " && lipo -archs ./hello.arm64 | |
| clang hello.c -target x86_64-apple-darwin-macho -o hello.x86_64 | |
| echo -n "hello.x86_64 is architecture " && lipo -archs ./hello.x86_64 | |
| lipo hello.arm64 hello.x86_64 -create -output hello | |
| echo -n "final output binary has archs " && lipo -archs ./hello |
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
| # -*- mode: snippet -*- | |
| # name: ifdef-disable | |
| # key: ifdef-disable | |
| # binding: M-# | |
| # expand-env: ((yas-wrap-around-region nil)) | |
| # -- | |
| #if 0 | |
| `yas-selected-text`#else | |
| $0 | |
| #endif |
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. |