Skip to content

Instantly share code, notes, and snippets.

@vertgo
vertgo / SwiftyJSON.swift
Created April 9, 2015 21:03
fixed swiftyjson, I think
// SwiftyJSON.swift
//
// Copyright (c) 2014 Ruoyu Fu, Pinglin Tang
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@leecade
leecade / 10.11_troubleshooting.md
Last active October 1, 2023 12:07
10.11_troubleshooting
@takecian
takecian / PushNotificationManager.swift
Last active November 13, 2015 13:45
Utility functions for iOS PushNotification
class PushNotificationManager {
class var isPushNotificationEnable: Bool {
let osVersion = UIDevice.currentDevice().systemVersion
if osVersion < "8.0" {
let types = UIApplication.sharedApplication().enabledRemoteNotificationTypes()
if types == UIRemoteNotificationType.None {
// push notification disabled
return false
}else{
// push notification enable
@dmrev
dmrev / SmartKey.swift
Last active December 11, 2015 18:28
Another statically-typed NSUserDefaults inspired by https://github.com/radex/SwiftyUserDefaults
class SmartKeyBase: Equatable, Hashable {
private let defaults = NSUserDefaults.standardUserDefaults()
private(set) static var allKeys = Set<SmartKeyBase>()
let name: String
static func removeAllValues() {
allKeys.forEach { $0.removeValue() }
}
init(_ name: String) {
@abarax
abarax / String.swift
Created December 2, 2015 04:22
String extensions for Swift
import Foundation
extension String
{
var length: Int {
get {
return self.characters.count
}
}