Skip to content

Instantly share code, notes, and snippets.

John D. Pope wwe-johndpope

Block or report user

Report or block wwe-johndpope

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View NavButtonBarExampleViewController.swift
// NavButtonBarExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// 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
@wwe-johndpope
wwe-johndpope / HTTPStub.swift
Created Mar 9, 2017
Sample stubbing of mock data from json
View HTTPStub.swift
//
// HTTPStub.swift
// Karhoo
//
// Created by John Pope on 9/14/16.
// Copyright © 2016 Karhoo Ltd. All rights reserved.
//
import Foundation
import UIKit
@wwe-johndpope
wwe-johndpope / HTTPStub.swift
Last active Mar 20, 2017
sample gist of OHHTTPStubs + API end points + local json files in bundle
View HTTPStub.swift
import Foundation
import UIKit
import OHHTTPStubs
import SwiftyJSON
@objc class HTTPStub: NSObject {
static let enableHttpStubbing = HTTPStub()
@wwe-johndpope
wwe-johndpope / dumpSwaggerJson.sh
Last active Apr 5, 2017
save out json to files.
View dumpSwaggerJson.sh
// chomd +x dumpSwaggerJson.sh
curl -X GET https://virtserver.swaggerhub.com/osman/emerald/1.0.0/channels -H "access-control-allow-origin: *" -H "accept: application/json" -H "content-type: application/json" > channels.json
curl -X GET https://virtserver.swaggerhub.com/osman/emerald/1.0.0/channels/channelContent?channelid=1092 -H "access-control-allow-origin: *" -H "accept: application/json" -H "content-type: application/json" > channel1092.json
curl -X GET https://virtserver.swaggerhub.com/osman/emerald/1.0.0/channels/channelContent?channelid=1701 -H "access-control-allow-origin: *" -H "accept: application/json" -H "content-type: application/json" > channel1701.json
curl -X GET https://virtserver.swaggerhub.com/osman/emerald/1.0.0/channels/channelContent?channelid=1408 -H "access-control-allow-origin: *" -H "accept: application/json" -H "content-type: application/json" > channel1408.json
curl -X GET https://virtserver.swaggerhub.com/osman/emerald/1.0.0/channels/channelContent?channelid=1078 -H "access-contro
@wwe-johndpope
wwe-johndpope / IndicatorInfo.swift
Created May 8, 2017
simple overloading functions
View IndicatorInfo.swift
public struct IndicatorInfo {
public var title: String
public var image: UIImage?
public var highlightedImage: UIImage?
public init(title: String) {
self.title = title
}
@wwe-johndpope
wwe-johndpope / API.scala
Created Sep 29, 2017
apollo generated code.
View API.scala
// This file was automatically generated and should not be edited.
import Apollo
/// The episodes in the Star Wars trilogy
public enum Episode: String {
case newhope = "NEWHOPE" /// Star Wars Episode IV: A New Hope, released in 1977.
case empire = "EMPIRE" /// Star Wars Episode V: The Empire Strikes Back, released in 1980.
case jedi = "JEDI" /// Star Wars Episode VI: Return of the Jedi, released in 1983.
}
View Airings.scala
// This file was automatically generated and should not be edited.
import Apollo
public final class SomestringQuery: GraphQLQuery {
public static let operationString =
"query SOMESTRING {" +
" Airings(channelId: \"MTV1\") @paginate(startIndex: 1, maxResults: 5) {" +
" __typename" +
" contentId" +
View Airings.graphql
query Airings {
Airings(channelId: $channelId) @paginate(startIndex: 1, maxResults: 5) {
contentId, mediaId, eventId, programId, partnerProgramId
startDate, endDate, expires
linear, runTime
playbackUrls {
rel
href
}
titles {
@wwe-johndpope
wwe-johndpope / BAMify.sh
Last active Oct 3, 2017
generate swift files.
View BAMify.sh
git clone https://github.com/Shopify/graphql_swift_gen.git
cd graphql_swift_gen
mkdir BAM
cd BAM
mkdir Source
cd ..
# optional - install RVM for ruby version managing.
curl -sSL https://get.rvm.io
rvm install ruby --latest
gem install bundler
View linkToTestWatchList.html
https://search-api-wwe-mock.bamgrid.com/svc/search/v2/graphql?query=fragment%20tag%20on%20Tag%20%7B%0A%20%20type%0A%20%20value%0A%20%20displayName%0A%7D%0A%0Afragment%20cmsItem%20on%20CmsItem%20%7B%0A%20%20contentId%0A%20%20type%0A%20%20tags(type%3A%20%24tag_types)%20%7B%0A%20%20%20%20...tag%0A%20%20%7D%0A%7D%0A%0Afragment%20hyperMediaLink%20on%20HypermediaLink%20%7B%0A%20%20href%0A%20%20params%20%7B%0A%20%20%20%20name%0A%20%20%20%20description%0A%20%20%7D%0A%20%20rel%0A%20%20templated%0A%7D%0A%0Afragment%20photo%20on%20Photo%20%7B%0A%20%20...cmsItem%0A%20%20height%0A%20%20imageLocation%0A%20%20masterCutId%0A%20%20width%0A%7D%0A%0Afragment%20photoAsset%20on%20PhotoAsset%20%7B%0A%20%20...cmsItem%0A%20%20altText%0A%20%20caption%0A%20%20credit%0A%20%20headline%0A%20%20rawImage%0A%20%20width%0A%20%20height%0A%20%20inning%0A%20%20purchaseUrl%0A%20%20photos(max_width%3A%20%24max_width%2C%20min_width%3A%20%24min_width%2C%20max_height%3A%20%24max_height%2C%20min_height%3A%20%24min_height%2C%20dimensions%3A%20%24dimen
You can’t perform that action at this time.