Skip to content

Instantly share code, notes, and snippets.

Bradley Snyder bradley219

Block or report user

Report or block bradley219

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ghost rules.txt
I will donate $4 to Michael J. Fox foundation (first 25 submissions only).
1. one entry per person
2. you must put your name on your entry
3. entry must be on 3"x3" post-it®
4. entry must be hand-drawn by the entrant and must be the original work, no mechanical reproductions
5. Negative space itself is not considered a drawing
6. Rules are subject to my (Tanner's) interpretation.
7. non-compliant entries will be put in quarantine zone for 24 hours, then if no convincing appeal is made, the entry will be shredded
bradley219 /
Created Dec 13, 2018
Convert a video file to high quality gif
View sendimessage.applescript
# Usage:
# osascript sendimessage.applescript <recipient> <message>
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
View num.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#include <getopt.h>
#define VERSION "1.1"
typedef enum {
bradley219 / readserial.c
Last active May 24, 2018
Simple utility for logging from serial port
View readserial.c
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <stdio.h>
#include <sys/select.h>
#include <signal.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
bradley219 /
Created Nov 27, 2017
Python script for generating a focus routine gcode file. To use, set parameters in the script and execute on the command line. Pipe the output into a gcode file. Example: `./ > focus.gcode`.
#!/usr/bin/env python
def g1_from_point(point):
return "G1 X{} Y{} Z{}\n".format(round(point[0], 5), round(point[1], 5), round(point[2], 5))
def g1_from_speed(speed):
return "G1 F{}\n".format(speed)
if __name__ == '__main__':
#!/usr/bin/env python
import sys
c =
while len(c) > 0:
c =
View bitcount.c
#include <stdint.h>
#include <stdio.h>
int ones_count(uint32_t i) {
    i = i - ((i >> 1) & 0x55555555);
    i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
    return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
int main (int argc, char *argv[]) {
bradley219 / fix_xcode_plugins
Last active Mar 14, 2018
Fix Xcode Plugin UUIDs
View fix_xcode_plugins
UUID=`defaults read /Applications/ DVTPlugInCompatibilityUUID`
echo "UUID=$UUID"
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add "$UUID"
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
You can’t perform that action at this time.