Skip to content

Instantly share code, notes, and snippets.


Keaton Burleson 128keaton

View GitHub Profile
128keaton /
Last active Jul 9, 2016 — forked from ibrahima/
Amazon Dash Button ARP listener script (not written by me)
import socket
import struct
import binascii
# Written by Bob Steinbeiser (
rawSocket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
MAC = '74c24671971c'
128keaton / license
Last active Apr 5, 2017 — forked from zzot/license
MIT License Generator
View license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
# $ license > COPYING
echo "Copyright (c) `date +%Y` Keaton Burleson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
128keaton / flashScreen.swift
Created Aug 29, 2019 — forked from bgreenlee/flashScreen.swift
Flashing the screen in Swift. Sticking this here because it took me a while to work out the right variable types and casting.
View flashScreen.swift
func flashScreen() {
let inDuration: CGDisplayFadeInterval = 0.0
let outDuration: CGDisplayFadeInterval = 1.0
let color = NSColor.white
var fadeToken: CGDisplayFadeReservationToken = 0
let colorToUse = color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)!
let err = CGAcquireDisplayFadeReservation(inDuration + outDuration, &fadeToken)
if err != CGError.success {