Skip to content

Instantly share code, notes, and snippets.

View 128keaton's full-sized avatar

Keaton Burleson 128keaton

View GitHub Profile
class CentralMenuButton: UIButton {
var label: UILabel?
var labelText: String!
var labelColor: UIColor!
var labelFont: UIFont!
var labelAlignment: NSTextAlignment!
override init(frame: CGRect) {
@128keaton
128keaton / flashScreen.swift
Created August 29, 2019 01:46 — 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.
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 {
Last login: Fri May 10 14:02:39 on ttys000
FusionDriveiMac:~ admin$ /usr/sbin/diskutil cs list -plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CoreStorageLogicalVolumeGroups</key>
<array>
<dict>
<key>CoreStorageLogicalVolumeFamilies</key>
2019/04/12 14:08:06:389 macOS Utilities-v2.65-b2
2019/04/12 14:08:06:389
2019/04/12 14:08:06:389
---------------------------LOGGER INITIALIZED---------------------------
2019/04/12 14:08:06:389
2019/04/12 14:08:06:389 Library folder does not exist at '/Users/admin/Library/Application Support/ER2/'
2019/04/12 14:08:06:389 Creating folder at path '/Users/admin/Library/Application Support/ER2/'
2019/04/12 14:08:06:390 Library folder exists at '/Users/admin/Library/Application Support/ER2/'
2019/04/12 14:08:06:390 Property list does not exist at '/Users/admin/Library/Application Support/ER2/com.er2.applications.plist'
2019/04/12 14:08:06:390 Copying property list from bundle
@128keaton
128keaton / navigation.js
Last active September 21, 2018 20:29
Client-side javascript that fetches menus from a Wordpress instance for another website.
// -------------------------------------------------------------
// Add page items
// (uses Wordpress plugins JSONMenu)
// -------------------------------------------------------------
$.ajax({
url: 'http://wp.dev.reviveit.io/?rest_route=/menus/v1/list',
dataType: 'application/json',
cache: 'true',
complete: function (data) {
console.log('Ajax request success');
@128keaton
128keaton / archiver.rb
Last active September 6, 2018 00:42
Creates a Wayback machine entry for URL
require 'net/https'
require 'uri'
class WebArchiver
def self.archive(url)
url = URI.parse("https://web.archive.org/save/#{url}")
req = Net::HTTP::Get.new(url.to_s)
res = Net::HTTP.start(url.host, url.port, :use_ssl => true) {|http|
http.request(req)
require 'json'
require 'net/http'
require 'uri'
require 'logger'
logger = Logger.new(STDOUT)
base_url = 'http://10.0.2.7:3001'
serial = `sudo dmidecode -t 1 | grep Serial | sed 's/.*: //g'`.strip!
require 'json'
require 'net/http'
require 'uri'
require 'logger'
logger = Logger.new(STDOUT)
#get machine serial number
serial = `sudo dmidecode -t 1 | grep Serial | sed 's/.*: //g'`.strip!
base_url = 'http://10.0.2.7:3001'
044d526abc3b038b5c298e76994f9aca88bfdf575a8e1bb99b640b069f05abaeda7c2a92f0f8176cdedd7a94b9ff7fa9a8071898dafb62bb59c78888ffa005243f
@128keaton
128keaton / test.md
Last active January 20, 2018 05:50
�F600;