I hereby claim:
- I am CanTheAlmighty on github.
- I am can (https://keybase.io/can) on keybase.
- I have a public key whose fingerprint is 2F82 5F81 6083 839E A2C3 577F 18F1 8091 E10F 6777
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
extension Int | |
{ | |
func times(f :(Int) -> ()) | |
{ | |
for i in 0..<self | |
{ | |
f(i) | |
} | |
} | |
} |
struct DictionaryTwoWay<S:Hashable,T:Hashable> : DictionaryLiteralConvertible | |
{ | |
// Literal convertible | |
typealias Key = S | |
typealias Value = T | |
// Real storage | |
private var st : [S : T] = [:] | |
private var ts : [T : S] = [:] | |
[alias] | |
llg = log --pretty=format:'%Cgreen%h%Creset %ad (%an) %s' --graph --date=relative |
extension NSData | |
{ | |
/// Creates a length-delimited, byte buffer | |
var buffer : UnsafeBufferPointer<UInt8> { get { return UnsafeBufferPointer(start: UnsafePointer<UInt8>(self.bytes), count: self.length) }} | |
} | |
extension String | |
{ | |
/// Initializes a string from the given data | |
init?(data : NSData, encoding : NSStringEncoding) |
// | |
// main.c | |
// ObviousHomeworkFucboi | |
// | |
// Created by Can on 3/9/15. | |
// Copyright (c) 2015 Can. All rights reserved. | |
// | |
#include <stdio.h> |
import UIKit | |
public extension UIColor | |
{ | |
class func components(alphaHex hex : UInt32) -> (r:UInt8, g:UInt8, b:UInt8, a:UInt8) | |
{ | |
let r = UInt8((hex & 0xFF000000) >> 24) | |
let g = UInt8((hex & 0x00FF0000) >> 16) | |
let b = UInt8((hex & 0x0000FF00) >> 8) | |
let a = UInt8((hex & 0x000000FF)) |
// | |
// DisplayLink.swift | |
// MetalMac | |
// | |
// Created by Jose Canepa on 8/18/16. | |
// Copyright © 2016 Jose Canepa. All rights reserved. | |
// | |
import AppKit |
required init?(coder decoder: NSCoder) | |
{ | |
super.init(coder: decoder) | |
prepareSubviews() | |
} | |
override init(frame: CGRect) | |
{ | |
super.init(frame: frame) | |
prepareSubviews() |