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 | |
// MAKING CHANGE --------------------------------------------- | |
func makingChange (amount: Int, denominations: [Int]) -> Int { | |
var waysOfDoingNCents: [Int] = [] | |
for _ in 0...amount { | |
waysOfDoingNCents.append(0) | |
} | |
waysOfDoingNCents[0] = 1 | |
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
extension Optional { | |
func then (_ handler: (Wrapped) -> Void) { | |
switch self { | |
case .some(let wrapped): return handler(wrapped) | |
case .none: break | |
} | |
} | |
} |
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
// Analytics helper created by @Quaggie - Jonathan Bijos | |
import UIKit | |
struct Analytics { | |
fileprivate let viewController: UIViewController | |
fileprivate let tracker = GAI.sharedInstance().defaultTracker | |
init (forScreen viewController: UIViewController) { | |
self.viewController = viewController |
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
// Created by Diogo Tridapalli on 9/13/16. | |
// Copyright © 2016 Diogo Tridapalli. All rights reserved. | |
import Foundation | |
public struct Log { | |
public static func info( | |
_ items: Any..., | |
functionName: String = #function, |
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
const Discord = require('discord.js') | |
const client = new Discord.Client() | |
const fetch = require('node-fetch') | |
const ytdl = require('ytdl-core') | |
const streamOptions = { seek: 0, volume: 1 } | |
let dispatcher = null; | |
const YOUTUBE_API_URL = 'https://www.googleapis.com/youtube/v3/search' |
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 Foundation | |
import UIKit | |
protocol Storyboardable: class { | |
static var storyboardName: String { get } | |
} | |
extension Storyboardable where Self: UIViewController { | |
static var storyboardName: String { | |
return String(describing: self) |
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
// | |
// Analytics.swift | |
// | |
// Created by Jonathan Bijos | |
// Copyright © 2017 @Quaggie. All rights reserved. | |
import UIKit | |
struct Analytics { | |
typealias Dimensions = [UInt: String] |
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
class DataSource: NSObject { | |
typealias Callback = ((IndexPath) -> Void)? | |
var names = [String]() | |
fileprivate var callback: Callback | |
init(names: [String]) { | |
super.init() | |
self.names = names | |
} |
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
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Monta a window de acordo com o tamanho da tela | |
window = UIWindow(frame: UIScreen.main.bounds) | |
// Instancia o ViewController | |
let vc = ViewController() | |
// Bota como tela principal dentro de uma navigationController | |
window?.rootViewController = UINavigationController(rootViewController: vc) | |
// Faz a window ser exibida | |
window?.makeKeyAndVisible() | |
return true |