Skip to content

Instantly share code, notes, and snippets.

View soffes's full-sized avatar

Sam Soffes soffes

View GitHub Profile
@soffes
soffes / 25.go
Last active August 29, 2015 14:05
Learn Go Exercises — http://tour.golang.org
// #25 — Loops and Functions
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
@soffes
soffes / CLLocationCoordinate2D+Equatable.swift
Last active September 11, 2024 14:15
Add Equatable to CLLocationCoordinate2D
import CoreLocation
extension CLLocationCoordinate2D: Equatable {}
public func ==(lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool {
return lhs.latitude == rhs.latitude && lhs.longitude == rhs.longitude
}
@soffes
soffes / Array+Each.swift
Created July 17, 2014 19:08
Each on Array in Swift
extension Array {
func each(block: ((Element) -> Void)) {
for i in 0..<count {
block(self[i])
}
}
func eachWithIndex(block: ((Element, Int) -> Void)) {
for i in 0..<count {
block(self[i], i)
@soffes
soffes / AFNetworkReachabilityStatus.swift
Created June 19, 2014 00:17
AFNetworkReachabilityStatus Swift extension
extension AFNetworkReachabilityStatus {
func toString() -> String {
switch self {
case .NotReachable:
return "none"
case .ReachableViaWiFi:
return "wifi"
case .ReachableViaWWAN:
return "wwan"
case .Unknown:
class APIClient {
}
var sharedAPIClient: APIClient = {
return APIClient()
}()
extension APIClient {
class func sharedClient() -> APIClient {
return sharedAPIClient
@soffes
soffes / Podfile
Created May 8, 2014 05:22
Pods used in Litely 1.0
platform :ios, '7.0'
# Core Data
pod 'SSDataKit', :git => 'https://github.com/soffes/SSDataKit', :commit => '60d432e734ae11e8cfedac8ac5f68c0ce8a1b9ba'
# On-disk & in-memory caching
pod 'SAMCache'
# Fast image view for Core Image
pod 'SAMCoreImageView', '0.1.3'
@soffes
soffes / keybase.md
Last active September 20, 2021 14:52

Keybase proof

I hereby claim:

  • I am soffes on github.
  • I am soffes (https://keybase.io/soffes) on keybase.
  • I have a public key ASCysfuxJROh3gB1FpEjcPIZmgCaOnFECNl8mGu3r0ozYQo

To claim this, I am signing this object:

// Poof! http://www.hulu.com/watch/1201
NSShowAnimationEffect(NSAnimationEffectPoof, center, CGSizeZero, nil, nil, NULL);
@soffes
soffes / Whiskey Smarts.markdown
Last active August 29, 2015 13:57
Just a little excerpt of a post I'm going to write on Whiskey's engine when it comes out.

Given the following Markdown:

# Some Header

This is a paragraph with a [link](http://usewhiskey.com).

iA Writer says there are 12 words. Byword says there are 11. Whiskey, a Markdown text editor I’m working on, says there are 9. Count them.

@soffes
soffes / GPUImageTextureInput+CIImage.h
Last active July 7, 2024 08:51
GPUImage + Core Image
//
// GPUImageTextureInput+CIImage.h
// GPUImage
//
// Created by Sam Soffes on 3/4/14.
// Copyright (c) 2014 Sam Soffes. All rights reserved.
//
#import "GPUImageTextureInput.h"