Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: Recent Posts Shortcode
* Plugin URI: http://www.phil-hudson.com/recent-posts-shortcode-wordpress-plugin/
* Description: A simple, open-source plugin to return your most recent posts via a shortcode. Use on any post or page: [recentPosts amountOfPosts="2"]. For more details please see: http://phil-hudson.com/recent-posts-shortcode-wordpress-plugin/
* Version: 0.1
* Stable: 4.2.2
* Author: Phil Hudson
* Author URI: http://www.phil-hudson.com
* License: GPL12
import UIKit
func localizedDate() -> NSDate {
let now: NSDate = NSDate()
let timeZone: NSTimeZone = NSTimeZone.localTimeZone()
let secondsOffset = timeZone.secondsFromGMTForDate(now)
let localTimeZoneDate: NSDate = now.dateByAddingTimeInterval(Double(secondsOffset))
return localTimeZoneDate
}
//https://www.raywenderlich.com/105365/in-app-purchases-tutorial-getting-started
private func failedTransaction(transaction: SKPaymentTransaction) {
print("failedTransaction...")
if transaction.error!.code != SKErrorCode.PaymentCancelled.rawValue {
print("Transaction error: \(transaction.error!.localizedDescription)")
}
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
}
//
// UnitOfMeasure.swift
//
// Created by Phil Hudson on 25/02/2016.
// Copyright © 2016 Phil Hudson. All rights reserved.
//
import Foundation
public class UnitOfMeasure {