Skip to content

Instantly share code, notes, and snippets.

View tonyarnold's full-sized avatar

Tony Arnold tonyarnold

View GitHub Profile
//
// Copyright © 2015 The CocoaBots. All rights reserved.
import Cocoa
import RealmSwift
enum RealmDocumentError: ErrorType {
case FailedToConvertURLToFilePath
}
@tonyarnold
tonyarnold / human.h.motemplate
Created September 7, 2014 11:22
My current mogenerator templates
#import "_<$managedObjectClassName$>.h"
@interface <$managedObjectClassName$> : _<$managedObjectClassName$> {}
// Custom logic goes here.
@end
@tonyarnold
tonyarnold / Array+NSArrayAppend.swift
Created July 6, 2014 05:10
Originally proposed and provided by Rob Rix allows you to append values from an NSArray to a Swift array, so long as they match the Swift array's expected element type.
import Foundation
@assignment func += <T:AnyObject> (inout array: T[], cocoaArray: NSArray) {
array.extend(
map(cocoaArray) {
$0 as T
}
)
}
import Foundation
class ViewModel: NSObject
{
struct SerializationKey
{
static let query = "query"
static let hasValidValues = "hasValidValues"
}
//
// Copyright (c) 2014 Tony Arnold & The CocoaBots. All rights reserved.
import Foundation
extension NSFileManager
{
func applicationSupportDirectoryURL() -> NSURL?
{
Pod::Spec.new do |s|
s.name = "ADNKit"
s.version = "2.0.0.dev.#{Time.now.to_i}"
s.summary = "Objective-C framework for building App.net applications on iOS and OS X."
s.description = "ADNKit is an Objective-C framework for building App.net iOS and OS X applications."
s.homepage = "https://github.com/joeldev/ADNKit"
s.license = {
:type => 'BSD',
:text => <<-LICENSE
Copyright (c) 2013, Joel Levin. All rights reserved.
@tonyarnold
tonyarnold / download-wwdc-vids.sh
Last active August 29, 2015 14:02
Downloads all of the available WWDC2014 videos (assuming you have access to them), skipping any that are already downloaded and resuming any that aren't. Requires wget, which can be installed via homebrew. Original credit goes to Krzysztof: https://twitter.com/merowing_/status/474071685826883584. You'll need to be running wget 1.15 or later for …
echo "Downloading HD Videos…"
curl https://developer.apple.com/videos/wwdc/2014/ | grep -iIoh 'http.*._hd_.*dl=1">HD' | sed -e 's/\?dl=1">HD//g' | xargs -n1 wget -N -c
echo "Downloading SD Videos…"
curl https://developer.apple.com/videos/wwdc/2014/ | grep -iIoh 'http.*._sd_.*dl=1">SD' | sed -e 's/\?dl=1">SD//g' | xargs -n1 wget -N -c
echo "Downloading PDFs…"
@tonyarnold
tonyarnold / clang-format
Last active August 29, 2015 14:01
My current ~/.clang-format
BasedOnStyle: Chromium
AlignTrailingComments: true
BreakBeforeBraces: Allman
ColumnLimit: 0
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerBindsToType: false
SpacesBeforeTrailingComments: 1
Pod::Spec.new do |s|
s.name = 'MagicalRecord'
s.version = '2.3.0.rc.1'
s.license = 'MIT'
s.summary = 'Super Awesome Easy Fetching for Core Data 1!!!11!!!!1!.'
s.homepage = 'http://github.com/magicalpanda/MagicalRecord'
s.author = { 'Saul Mora' => '[email protected]' }
s.source = { :git => 'https://github.com/magicalpanda/MagicalRecord.git', :tag => "#{s.version}" }
s.description = 'Handy fetching, threading and data import helpers to make Core Data a little easier to use.'
s.framework = 'CoreData'

Keybase proof

I hereby claim:

  • I am tonyarnold on github.
  • I am tonyarnold (https://keybase.io/tonyarnold) on keybase.
  • I have a public key whose fingerprint is 18A1 A00E A362 838B C7AE 10B3 0594 05EE 21FD 4B28

To claim this, I am signing this object: