This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UnitOfMeasure.swift | |
// | |
// Created by Phil Hudson on 25/02/2016. | |
// Copyright © 2016 Phil Hudson. All rights reserved. | |
// | |
import Foundation | |
public class UnitOfMeasure { |