Skip to content

Instantly share code, notes, and snippets.

View bebrws's full-sized avatar

Brad Barrows bebrws

View GitHub Profile
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active May 16, 2024 12:27
Xcode KeyBindings as VSCode
@danielpunkass
danielpunkass / gray.c
Created April 9, 2019 12:22
Standalone tool using private Apple framework to toggle display grayscale mode
#include <stdio.h>
// Compile with cc -o gray gray.c -framework UniversalAccess -F /System/Library/PrivateFrameworks
extern void UAGrayscaleSetEnabled(int isEnabled);
extern int UAGrayscaleIsEnabled();
int main() {
UAGrayscaleSetEnabled(!UAGrayscaleIsEnabled());
}
@2opremio
2opremio / bpf.c
Last active April 2, 2024 18:54 — forked from msantos/bpf.c
Example of using bpf to capture packets in OSX
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
@mlafeldt
mlafeldt / elf.h
Last active May 5, 2024 05:35
elf.h for OSX
/* This is the original elf.h file from the GNU C Library; I only removed
the inclusion of feature.h and added definitions of __BEGIN_DECLS and
__END_DECLS as documented in
https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html
On macOS, simply copy the file to /usr/local/include/.
Mathias Lafeldt <mathias.lafeldt@gmail.com> */
/* This file defines standard ELF types, structures, and macros.