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
// | |
// ScrollingDecelerator.swift | |
// ShopBack | |
// | |
// Created by Tai Le on 6/5/20. | |
// Copyright © 2020 levantAJ. All rights reserved. | |
// | |
final class ScrollingDecelerator { | |
weak var scrollView: UIScrollView? |
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
#!/bin/sh | |
RESET=`tput sgr0` | |
RED=`tput setaf 1` | |
GREEN=`tput setaf 2` | |
if [ "$1" ]; then | |
if ! [ -e "$1" ] | |
then |
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
// Method use for logging for debugging | |
function autoFillGettingLog(message) { | |
window.webkit.messageHandlers.autoFillGettingShippingInfoLog.postMessage(message); | |
} | |
autoFillGettingLog("Beginning...."); | |
/// The configuration xpath will be replace before injected to IAB | |
/// format: [{xPath, key, value}] | |
var autoFillGettingConfigurationXPathsString = "checkout-configuration-xpaths"; |
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
function autoFillFillingLog(message) { | |
window.webkit.messageHandlers.autoFillFillingShippingInfoLog.postMessage(message); | |
} | |
autoFillFillingLog("Beginning...."); | |
/// The configuration xpath will be replace before injected to IAB | |
/// format: [{xPath, key, value}] | |
var autoFillFillingConfigurationXPathsString = "checkout-configuration-xpaths"; |
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 ImageIO | |
import AVFoundation | |
var cvPixelBuffer: CVPixelBuffer? { | |
var pixelBuffer: CVPixelBuffer? = nil | |
let options: [NSObject: Any] = [ | |
kCVPixelBufferCGImageCompatibilityKey: false, | |
kCVPixelBufferCGBitmapContextCompatibilityKey: false, | |
] | |
let status = CVPixelBufferCreate(kCFAllocatorDefault, Int(size.width), Int(size.height), kCVPixelFormatType_32BGRA, options as CFDictionary, &pixelBuffer) |
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
// MARK: - String | |
extension String { | |
func aes256ECBPKCS5(hexKey: String) throws -> Data { | |
let keyData: NSData = try Data(hex: hexKey) as NSData | |
let data: NSData = Data(utf8) as NSData | |
guard let cryptData: NSMutableData = NSMutableData(length: Int(data.length) + kCCBlockSizeAES128) else { | |
throw NSError(domain: "", code: 1234, userInfo: [NSLocalizedDescriptionKey: "Prepare crypt data failed"]) |
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
#!/usr/bin/env ruby | |
def supported_staticlib_pods | |
return ['YouTubeVideoPlayer'] | |
end | |
# Improve Pre-main Time | |
# Using `staticlib` | |
# Removing the `staticlib` from `[CP] Embed Pods Frameworks` | |
def improve_pre_main_time_loading(installer, project_name) |
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 USDZNode: SCNReferenceNode { | |
init?( | |
name: String, | |
position: SCNVector3? = nil, | |
scale: SCNVector3? = nil, | |
pivot: SCNMatrix4? = nil | |
) { | |
guard let usdzURL: URL = Bundle.main.url(forResource: name, withExtension: "usdz") else { return nil } | |
super.init(url: usdzURL) | |
if let scale: SCNVector3 = scale { |
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
{ | |
"Simulator Target Bundle": "com.yourapp.YourAppName", | |
"aps": { | |
"alert": { | |
"body": "Testing Message", | |
"title": "Test Notification" | |
} | |
} | |
} |
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 Reactive where Base: UIViewController { | |
var presenting: Observable<UIViewController> { | |
return sentMessage(#selector(Base.present(_:animated:completion:))) | |
.compactMap({ args -> UIViewController? in | |
return args.first as? UIViewController | |
}) | |
.do(onError: { error in | |
assertionFailure("\(error)") | |
}) | |
} |
NewerOlder