Skip to content

Instantly share code, notes, and snippets.

Avatar

Keaton Burleson 128keaton

View GitHub Profile
@128keaton
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 {
@128keaton
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
#!/bin/sh
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
128keaton / dash-listen-3.py
Last active Jul 9, 2016 — forked from ibrahima/dash-listen-3.py
Amazon Dash Button ARP listener script (not written by me)
View dash-listen-3.py
import socket
import struct
import binascii
# Written by Bob Steinbeiser (https://medium.com/@xtalker)
rawSocket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
socket.htons(0x0003))
MAC = '74c24671971c'
You can’t perform that action at this time.