Skip to content

Instantly share code, notes, and snippets.

View frosty's full-sized avatar
💭
AFK until April 11

James Frost frosty

💭
AFK until April 11
View GitHub Profile
diff --git a/WordPress/Classes/ViewRelated/Post/AbstractPostListViewController.swift b/WordPress/Classes/ViewRelated/Post/AbstractPostListViewController.swift
index 49d4673..9dc5ec7 100644
--- a/WordPress/Classes/ViewRelated/Post/AbstractPostListViewController.swift
+++ b/WordPress/Classes/ViewRelated/Post/AbstractPostListViewController.swift
@@ -162,10 +162,6 @@ class AbstractPostListViewController : UIViewController, WPContentSyncHelperDele
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
- if searchController.active {
- searchController.active = false
diff --git a/WordPress/Classes/Services/Store.swift b/WordPress/Classes/Services/Store.swift
index daa668b..e8112f6 100644
--- a/WordPress/Classes/Services/Store.swift
+++ b/WordPress/Classes/Services/Store.swift
@@ -30,6 +30,10 @@ struct StoreKitCoordinator {
typealias PendingPayment = (planID: PlanID, productID: String, siteID: Int)
+enum StoreCoordinatorError: ErrorType {
+ case PaymentAlreadyInProgress
diff --git a/WordPress/Classes/Services/PlanService.swift b/WordPress/Classes/Services/PlanService.swift
index 7b7d31c..0ee6982 100644
--- a/WordPress/Classes/Services/PlanService.swift
+++ b/WordPress/Classes/Services/PlanService.swift
@@ -1,12 +1,18 @@
import Foundation
+typealias PlanFeatures = [PlanID: [PlanFeature]]
+
struct PlanService {
diff --git a/WordPress/Classes/Models/Plan.swift b/WordPress/Classes/Models/Plan.swift
index 5a4826d..ba8053c 100644
--- a/WordPress/Classes/Models/Plan.swift
+++ b/WordPress/Classes/Models/Plan.swift
@@ -14,6 +14,16 @@ struct Plan {
let fullTitle: String
let description: String
let productIdentifier: String?
+ var featureGroups = [PlanFeatureGroup]()
+
@frosty
frosty / parser.rb
Last active August 29, 2015 14:07
iTunes Receipt Email Parser
class ReceiptParser
attr_reader :counts, :prices
def initialize(currency_symbol)
if (currency_symbol == "") then currency_symbol = "£" end
@currency_symbol = currency_symbol
@all_items = []
@counts = { :ios_apps => 0, :iaps => 0 }
@prices = { :ios_apps => 0, :iaps => 0 }
end
@frosty
frosty / gist:5727345
Created June 7, 2013 06:11 — forked from supermarin/gist:5597771
Example of asynchronous testing in Kiwi
//
// BeerTests.m
// Beer
//
// Created by Marin Usalj on 5/16/13.
// Copyright 2013 @mneorr | mneorr.com. All rights reserved.
//
#import "Kiwi.h"
@implementation ADNClient
+ (id)sharedClient
{
static dispatch_once_t pred = 0;
__strong static id _sharedObject = nil;
dispatch_once(&pred, ^{
_sharedObject = [[self alloc] init];
});
return _sharedObject;
<?xml version="1.0" encoding="utf-8"?>
<project>
<app title="Flixel Test" file="Flixel Test" main="Main" version="0.0.1" company="Zaphod" />
<window width="1024" height="768" fps="30" orientation="portrait" resizable="true" if="target_flash" />
<window width="0" height="0" fps="30" orientation="landscape" fullscreen="true" unless="target_flash" />
<set name="BUILD_DIR" value="Export" />
@frosty
frosty / Backgammon.lua
Created April 9, 2012 21:34
Codea Backgammon
--# Counter
CTYPE_WHITE = 0
CTYPE_BLACK = 1
CTYPE_PLACEWHITE = 2
CTYPE_PLACEBLACK = 3
Counter = class()
function Counter:init(x, y, t)
self.pos = vec2(x,y)
@frosty
frosty / gist:1880241
Created February 22, 2012 00:45
Codea raycaster
--# Main
-- based on untextured raycaster example: http://lodev.org/cgtutor/raycasting.html
MAPWIDTH = 24
MAPHEIGHT = 24
worldMap = {
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},