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 November 5, 2024 00:58
Xcode KeyBindings as VSCode
@ChristopherA
ChristopherA / macOS-Preferences-Defaults.sh
Last active October 8, 2024 04:12
macOS Preferences Defaults
#!/usr/bin/env zsh
#===========================================================================
# * INFO
#
# macOS Preferences Defaults
# By Christopher Allen @ChristopherA https://github.com/christophera/
# My most basic macOS preferences, in this gist to make it easy to load on
# multiple machines and VMs. Ideally runs on all macOS versions since Yosemite,
@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>
@TomCan
TomCan / restart-samba.sh
Created July 23, 2015 14:53
Restart Mac OS X smb service from terminal/cli
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist EnabledServices -array disk
@mlafeldt
mlafeldt / elf.h
Last active September 13, 2024 16:49
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 <[email protected]> */
/* This file defines standard ELF types, structures, and macros.