Skip to content

Instantly share code, notes, and snippets.

View a2's full-sized avatar
🐼

Alex Akers a2

🐼
View GitHub Profile
import UIKit
protocol myProtocol: class {
func dothatthing () -> Void
}
var array : [protocol<myProtocol>] = []
class A : myProtocol {
func dothatthing() {
import CoreLocation
import UIKit
extension CLLocationCoordinate2D {
init() {
self.init(latitude: 0, longitude: 0)
}
static var invalidCoordinate: CLLocationCoordinate2D {
return kCLLocationCoordinate2DInvalid
class Mutex {
private let _mutex = UnsafeMutablePointer<pthread_mutex_t>.alloc(1)
init() {
pthread_mutex_init(_mutex, nil)
}
func lock() -> Int32 {
return pthread_mutex_lock(_mutex)
}

Keybase proof

I hereby claim:

  • I am a2 on github.
  • I am a2 (https://keybase.io/a2) on keybase.
  • I have a public key whose fingerprint is 5293 8767 DF1B 7305 FC2D C900 0B2C 3A3F E158 7E95

To claim this, I am signing this object:

@a2
a2 / A2DictionaryOfVariableBindings.h
Last active August 29, 2015 14:06
A2DictionaryOfVariableBindings
@import Foundation;
#define A2DictionaryOfVariableBindings(...) _A2DictionaryOfVariableBindings(@"" # __VA_ARGS__, __VA_ARGS__, nil)
extern NSDictionary *_A2DictionaryOfVariableBindings(NSString *commaSeparatedKeysString, id firstValue, ...); // not for direct use
@a2
a2 / CoreGraphicsExtensions.swift
Created July 25, 2014 00:03
CGRectDivide override that returns a tuple.
import CoreGraphics
func CGRectDivide(rect: CGRect, amount: CGFloat, edge: CGRectEdge) -> (slice: CGRect, remainder: CGRect) {
var slice = CGRectZero
var remainder = CGRectZero
CGRectDivide(rect, &slice, &remainder, amount, edge)
return (slice, remainder)
}
/***
* Bitmap Loader
* Copyright © 2013 Matthew Tole
*
* Version 2.0.2
***/
#include <pebble.h>
#include "bitmap-loader.h"
@a2
a2 / tgmath.h
Created January 16, 2014 23:54
Exported `tgmath.h` #defines for use with the `Darwin.C.tgmath` Objective-C module.
@import Darwin.C.tgmath;
// acos
#undef acos
#define acos(__x) __tg_acos(__tg_promote1((__x))(__x))
// asin
#undef asin
#define asin(__x) __tg_asin(__tg_promote1((__x))(__x))
@a2
a2 / StoreKit.h
Created November 24, 2013 14:14
SKHandleInvalidReceiptRequest & SKTerminateForInvalidReceipt
@import StoreKit;
@interface SKHandleInvalidReceiptRequest : SKRequest
- (void)_sendXPCMessage;
@end
extern void SKTerminateForInvalidReceipt(void);
Pod::Spec.new do |s|
s.name = "ChimpKit2"
s.version = "0.1.1"
s.homepage = "https://github.com/mailchimp/ChimpKit2"
s.summary = "MailChimp API Wrapper with support for API 1.3."
s.license = 'MIT'
s.author = { "Amro Mousa" => "[email protected]" }
s.source = { :git => "https://github.com/mailchimp/ChimpKit2.git", :branch => "master" }
s.platform = :ios, '5.0'
s.source_files = 'Core/Classes/*.{h,m}'