Skip to content

Instantly share code, notes, and snippets.

View wwe-johndpope's full-sized avatar

John D. Pope wwe-johndpope

View GitHub Profile
// 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
Last active March 20, 2017 23:10
sample gist of OHHTTPStubs + API end points + local json files in bundle
import Foundation
import UIKit
import OHHTTPStubs
import SwiftyJSON
@objc class HTTPStub: NSObject {
static let enableHttpStubbing = HTTPStub()
@wwe-johndpope
wwe-johndpope / dumpSwaggerJson.sh
Last active April 5, 2017 19:47
save out json to files.
// 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 15:10
simple overloading functions
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 September 29, 2017 17:25
apollo generated code.
// 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.
}
// 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" +
query Airings {
Airings(channelId: $channelId) @paginate(startIndex: 1, maxResults: 5) {
contentId, mediaId, eventId, programId, partnerProgramId
startDate, endDate, expires
linear, runTime
playbackUrls {
rel
href
}
titles {
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
@wwe-johndpope
wwe-johndpope / BAMify.sh
Last active October 3, 2017 17:37
generate swift files.
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
package com.wwe.universe.ui.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;