I hereby claim:
- I am jstn on github.
- I am ouellette (https://keybase.io/ouellette) on keybase.
- I have a public key ASCnfu-Ia5yAtEsb4pUhLwOpUbODSRFNuSJDG6LcbLPwxwo
To claim this, I am signing this object:
I am attesting that this GitHub handle jstn is linked to the Tezos account tz1dW4z811rbrACxH5PTu5VtdhRisLZUDhdU for tzprofiles | |
sig:edsigtvwUeibQMzSm2pfT6gSJYfSXcBxkcUUATAMid3s9sm5D1k2KSXjzMY7r3ticACeMSqivxvpew2n9AgCJNpVpcyB6miduhC |
<!-- | |
(c) {CopyrightYears} {Title} | |
{BlogURL} | |
min theme by jstn | |
https://gist.github.com/jstn/5a67fd6c035bb86d1c504c98fa9cac07 | |
--> | |
<html> |
function git_prompt() { | |
local dirty="" | |
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then | |
dirty="*" | |
fi | |
if ! git diff --quiet 2> /dev/null; then | |
dirty="*" | |
fi |
I hereby claim:
To claim this, I am signing this object:
{ | |
"caret_extra_bottom": 2, | |
"caret_extra_top": 2, | |
"caret_extra_width": 1, | |
"caret_style": "phase", | |
"color_scheme": "Packages/Base16 Color Schemes/Themes/base16-oceanicnext.tmTheme", | |
"create_window_at_startup": false, | |
"ensure_newline_at_eof_on_save": true, | |
"fold_buttons": false, | |
"folder_exclude_patterns": |
[Unit] | |
Description=netdata | |
After=network.service | |
Requires=network.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=true | |
ExecStart=/usr/sbin/netdata | |
ExecStop=/usr/bin/killall netdata |
/* | |
No-Starve and Read/Write mutexes, based on GCD in Swift 3.0 | |
Inspired by the Little Book of Semaphores: http://greenteapress.com/wp/semaphores/ | |
*/ | |
import Foundation | |
final class NoStarveMutex { | |
private final let _semaphoreA = DispatchSemaphore(value: 1) | |
private final let _semaphoreB = DispatchSemaphore(value: 0) |
import UIKit | |
extension UIViewController { | |
func animateKeyboardWillChangeFrame(n: NSNotification?, animations: (keyboardFrameEnd: CGRect) -> Void) { | |
if let info = n?.userInfo as? Dictionary<String,AnyObject> { | |
let frameBeginValue = info[UIKeyboardFrameBeginUserInfoKey] as NSValue | |
let frameEndValue = info[UIKeyboardFrameEndUserInfoKey] as NSValue | |
let durationNumber = info[UIKeyboardAnimationDurationUserInfoKey] as NSNumber | |
let curveNumber = info[UIKeyboardAnimationCurveUserInfoKey] as NSNumber |
/* | |
var t = Timer() | |
t.start() | |
// do something | |
t.stop() | |
print("took \(t.seconds)") | |
*/ |
// requires a bridging header with this: | |
// #import <CommonCrypto/CommonCrypto.h> | |
func MD5(_ string: String) -> String? { | |
let length = Int(CC_MD5_DIGEST_LENGTH) | |
var digest = [UInt8](repeating: 0, count: length) | |
if let d = string.data(using: String.Encoding.utf8) { | |
d.withUnsafeBytes { (body: UnsafePointer<UInt8>) in | |
CC_MD5(body, CC_LONG(d.count), &digest) | |
} |