This file contains hidden or 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
| //: A UIKit based Playground for presenting user interface | |
| import SwiftUI | |
| import PlaygroundSupport | |
| struct ContentView: View { | |
| var body: some View { | |
| VStack(spacing: 16) { | |
| Text("Hello, SwiftUI!") | |
| .font(.largeTitle) |
This file contains hidden or 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 requests | |
| import jwt | |
| import time | |
| from datetime import datetime, timedelta | |
| import csv | |
| # --- CONFIGURATION --- | |
| ISSUER_ID = '' | |
| KEY_ID = '' | |
| APP_ID = '' |
This file contains hidden or 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://web.archive.org/web/20210621172103/https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video | |
| Output one image every second, named out1.png, out2.png, out3.png, etc. | |
| ffmpeg -i input.flv -vf fps=30 out%d.png | |
| 30 frames per second | |
| ffmpeg -i input.flv -vf fps=30 out%d.png | |
| Extract portions | |
| ffmpeg -i champlin-vs-blain137.mp4 -ss 00:30:00 -to 00:30:15 -c copy c-vs-b-part1.mp4 |
This file contains hidden or 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 AVFoundation | |
| @objc(QRScanner) | |
| class QRScanner : CDVPlugin, AVCaptureMetadataOutputObjectsDelegate { | |
| class CameraView: UIView { | |
| var videoPreviewLayer:AVCaptureVideoPreviewLayer? | |
| func interfaceOrientationToVideoOrientation(_ orientation : UIInterfaceOrientation) -> AVCaptureVideoOrientation { |
This file contains hidden or 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 java.security.KeyStore; | |
| import java.security.cert.X509Certificate; | |
| import java.util.Arrays; | |
| import javax.net.ssl.TrustManager; | |
| import javax.net.ssl.TrustManagerFactory; | |
| import javax.net.ssl.X509TrustManager; | |
| /* | |
| I hate that I had to write java again and its 2019 | |
| */ |
This file contains hidden or 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 testExample() { | |
| let provider = GitHubProvider(requestClosure: { (endpoint, requestResultClosure) in | |
| if let urlRequest = endpoint.urlRequest, | |
| let url = urlRequest.url, | |
| let headers = urlRequest.allHTTPHeaderFields { | |
| XCTAssertEqual(url.absoluteString, "https://github.com") | |
| // map body to object urlRequest.httpBody using ObjectMapper | |
| // or map object to data | |
| XCTAssertEqual(urlRequest.httpBody, Data()) | |
| // map the headers as well. |
This file contains hidden or 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
| protocol RoutableIdentifiable: Routable { | |
| var routeIdentifier: RouteElementIdentifier { get set } | |
| } | |
| class NavigationController: UIViewController, UINavigationControllerDelegate { | |
| let rootViewController: UIViewController | |
| private let childNavigationController: UINavigationController | |
| required init(rootViewController: UIViewController) { |
This file contains hidden or 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
| - (void)configureAnalytics { | |
| NSString *propertyID = @"UA-51388820-1"; | |
| BOOL (^shouldFireBlock)(id, NSArray*) = ^BOOL (id instance, NSArray *arguments) { | |
| if([instance isKindOfClass:[UINavigationController class]]) { | |
| return NO; | |
| } | |
| NSString *className = NSStringFromClass([instance class]); | |
| if([className hasPrefix:@"GK"]) { |