Skip to content

Instantly share code, notes, and snippets.

View 128keaton's full-sized avatar

Keaton Burleson 128keaton

View GitHub Profile
@128keaton
128keaton / dart.playground
Last active April 26, 2017 17:51
Calculating Pi with a Dartboard
import UIKit
import PlaygroundSupport
import SpriteKit
/*: pidarts.playground
# Calculating Pi with a Dart Board
____________
## a.k.a. "Monte Carlo algorithm"
To calculate pi for a circle inside of a square, we throw darts at the square and tally up the ones in the circle and tally up the ones outside of the circle separately.
____________
//
// DeepPressGestureRecognizer.swift
// DeepPressGestureRecognizer
//
// Created by SIMON_NON_ADMIN on 03/10/2015.
// Copyright © 2015 Simon Gladman. All rights reserved.
//
// Thanks to Alaric Cole - bridging header replaced by proper import :)
import AudioToolbox
//
// AnimatedSelectionView.swift
//
// Created by Keaton Burleson on 4/12/17.
// Copyright © 2017 Keaton Burleson. All rights reserved.
//
import Foundation
import UIKit
import QuartzCore
@128keaton
128keaton / license
Last active April 5, 2017 18:09 — forked from zzot/license
MIT License Generator
#!/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
language: ruby
cache: bundler
install:
- bundle install
script: bundle exec rake site:deploy --quiet
rvm:
- 2.1.2
env:
global:
secure: /* remove this line */
16:15:34.009 xcodebuild[59028:605983] Beginning test session DownTests-79AFBE4D-DB25-464A-968B-B5DB2408C251 at 2017-03-06 16:15:34.007 with Xcode 8C1002 on target <DVTLocalComputer: 0x7ffe0c589d30 (My Mac | x86_64)> (10.12.3 (16D32))
16:15:34.009 xcodebuild[59028:605983] /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
-project
Down.xcodeproj
-scheme
Down-macOS
-sdk
macosx
-destination
platform=OS X,arch=x86_64
{"image"=>"false", "text"=>"/var/www/html/fun/Panucci/public/images", :children=>[{"image"=>"false", "text"=>"Dell", :children=>[{"image"=>"false", "text"=>"Desktop", :children=>[{"image"=>"false", "text"=>"E6400", :children=>[{"image"=>"true", "text"=>"Dell_80G"}]}]}]}, {"image"=>"false", "text"=>"Lenovo", :children=>[]}, nil, {"image"=>"false", "text"=>"HP", :children=>[{"image"=>"false", "text"=>"8200", :children=>[{"image"=>"true", "text"=>"HP_120G copy 2"}, {"image"=>"true", "text"=>"HP_80G"}, {"image"=>"true", "text"=>"HP_120G copy"}, {"image"=>"true", "text"=>"HP_120G"}]}]}]}
@128keaton
128keaton / interfacez
Last active February 10, 2017 21:24
netconf
2: ens1f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether f4:ce:46:a6:67:a8 brd ff:ff:ff:ff:ff:ff
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ac:16:2d:78:2f:fc brd ff:ff:ff:ff:ff:ff
inet 10.0.2.138/24 brd 10.0.2.255 scope global eno1
valid_lft forever preferred_lft forever
inet6 fe80::ae16:2dff:fe78:2ffc/64 scope link
valid_lft forever preferred_lft forever
4: ens1f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether f4:ce:46:a6:67:a9 brd ff:ff:ff:ff:ff:ff
@128keaton
128keaton / DestinationView.swift
Last active June 6, 2018 14:02
Dragging view in Swift 3
import Foundation
import Cocoa
class DestinationView: NSView {
var isHighlighed: Bool! = false
override func awakeFromNib() {
self.register(forDraggedTypes: [NSFilenamesPboardType])
}
func isHighlighted() -> Bool! {
I was browsing
Down a reddit thread
Just a-looking
For a jailbreak exploit
One dude