Skip to content

Instantly share code, notes, and snippets.

Ann Catherine Jose annjose

View GitHub Profile
View OpenUserProfileNotification.swift
extension Notifications {
struct openUserProfile:NotificationType {
var userId:String
static var name: Notification.Name {
return Notification.Name(“LP_openUserProfile”)
}
var name:Notification.Name {
return openUserProfile.name
@annjose
annjose / XcodePlaygroundUnitTests.swift
Last active Mar 18, 2019
Run unit tests inside Xcode playground
View XcodePlaygroundUnitTests.swift
//: [Previous](@previous)
import Foundation
import XCTest
struct TodoItem {
let title: String
let dueBy: Date?
@annjose
annjose / CleanerSwiftCode.swift
Last active Nov 22, 2016
Code sample demonstrated in Rob Napier video on writing clean Swift code
View CleanerSwiftCode.swift
// sample code for Rob Napier's video 'Swift Legacy Functional Programming' found in Realm News
// the article also explains how to use Swift to avoid bugs and write cleaner code
// URL: https://realm.io/news/tryswift-rob-napier-swift-legacy-functional-programming/
// ============ Use Enum for OR relationship; use Struct for AND relationship =======================
struct Credential {
let username: String
let password: String
}
@annjose
annjose / ProtocolExtensions-RayWenderlich-Sample.swift
Created Nov 22, 2016
Sample code for the article on Protocol Extensions at Ray Wenderlich
View ProtocolExtensions-RayWenderlich-Sample.swift
// Article Name: Introducing Protocol-Oriented Programming in Swift 2
// Article URL: https://www.raywenderlich.com/109156/introducing-protocol-oriented-programming-in-swift-2
protocol Flyable {
var speed: Double { get }
}
protocol Bird {
var name: String { get }
var canFly: Bool { get }
}
@annjose
annjose / build_install_mono_OSX
Created May 29, 2014
Build and Install Mono on OSX Smoothly
View build_install_mono_OSX
#!/bin/sh
##
# Consolidated script that compiles and installs Mono smoothly on Mac OS X.
# This script installs the dependencies (autoconf, automake, libtool), downloads Mono source and compiles it
# This script is originally from http://www.mono-project.com/Compiling_Mono_on_OSX
#
PREFIX=/usr/local
You can’t perform that action at this time.