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/perl -w | |
use strict; | |
# update this whe n new versions of llvm come out | |
my $llvm_version = 19; | |
# mint has a file that lets you know the ubuntu upstream release version | |
sub get_dist_version_from_mint { | |
open my $fh, '<', '/etc/upstream-release/lsb-release' or die; |
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> | |
#include <stdint.h> // uintptr_t | |
#include <stddef.h> // size_t | |
// enable printing sizes as ints to avoid faliing on compilers that don't support %zu | |
#define SIZEOF(expr) (int)sizeof(expr) | |
#define PRINT_SIZEOF(expr) printf("sizeof(%-11s) = %1d\n", #expr, SIZEOF(expr)) | |
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
/* ftg_bitbuffer - public domain library | |
no warranty implied; use at your own risk | |
Tightly pack values by bits into a stream of bytes. | |
For example, a 1-bit bool and a 32-bit integer are packed into 33 | |
bits. | |
Bitbuffers are intended for small amounts of data, like a few | |
hundred network packets where size is important enough to remove |
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
;; | |
;; remedybg minor mode | |
;; | |
;; 0.1 by Michael Labbe | |
;; | |
(setq remedybg-path "c:/remedydbg/remedybg.exe") | |
(defun remedybg-add-breakpoint-at-file() | |
(interactive) |
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
#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 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 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 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 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 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 |
NewerOlder