Skip to content

Instantly share code, notes, and snippets.

Abizer Nasir Abizern

Block or report user

Report or block Abizern

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Scanner+Swift.swift
// Scanner+Swift.swift
// A set of idiomatic swift extensions to Scanner
// Based on
// Converted to Swift 3
import Foundation
Abizern / NSURL+StandardURLs.swift
Last active Jan 4, 2016
NSURL extension for common directory URLs
View NSURL+StandardURLs.swift
import Foundation
/// abstract: Convenience methods for getting standard URLs
extension NSURL {
/// The URL to the Documents directory
static var documentsURL: NSURL {
return try! NSFileManager.defaultManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: true)
Abizern / Cartfile.private
Last active Feb 5, 2016
Common Cartfile
View Cartfile.private
github "jspahrsummers/xcconfigs"
github "JungleCandy/LoggingPrint"
Abizern / Timer.swift
Last active Apr 20, 2016
An example of overloaded functions in Swift. - More explanation at
View Timer.swift
//: Playground - noun: a place where people can play
import Foundation
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
// Extend NSTimeInterval to provide the conversion functions.
extension NSTimeInterval {
Abizern / RepeatingTimer.swift
Last active Dec 8, 2016
A function that creates and starts a timer dispatch source.
View RepeatingTimer.swift
// RepeatingTimer.swift
import Foundation
enum TimerError: ErrorType {
/// The timer could not be created.
case CouldNotCreate
Abizern / formatter.swift
Last active Aug 29, 2015
You don't need to declare a custom class to have a singleton formatter, just use a global lazy var.
View formatter.swift
var formatter: NSNumberFormatter = {
let f = NSNumberFormatter()
f.locale = NSLocale.currentLocale()
f.maximumFractionDigits = 2
f.minimumFractionDigits = 2
f.alwaysShowsDecimalSeparator = true
f.numberStyle = .CurrencyStyle
return f
Abizern / loggingPrint.swift
Last active Jan 3, 2019
Debug logging for Swift
View loggingPrint.swift
// LoggingPrint.swift
import Foundation
Prints the filename, function name, line number and textual representation of `object` and a newline character into
the standard output if the build setting for "Active Complilation Conditions" (SWIFT_ACTIVE_COMPILATION_CONDITIONS) defines `DEBUG`.
Abizern / MockingTest.m
Last active Jan 4, 2016
Test for OCMock installation into an Xcode project.
View MockingTest.m
// MockingTest.m
#import <OCMock/OCMock.h>
@interface MockingTest : XCTestCase
Abizern / SmokeSpec.m
Created May 1, 2014
A simple test file that can be added to a project to smoke test the Specta and Expecta installation
View SmokeSpec.m
// SmokeSpec.m
#import <Specta/Specta.h>
#import <Expecta/Expecta.h>
View cookie.hs
You can’t perform that action at this time.