-
首先启动一个Git Bash窗口(非Windows用户直接打开终端)
-
执行:
cd ~/.ssh
如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!
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
// Since the WKWebView has no sizeToFit() method, increase the frame height of the webView to | |
// match the height of the content's scrollHeight | |
// | |
// The WKWebView's `navigationDelegate` property needs to be set for the delegate method to be called | |
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | |
if webView.isLoading == false { | |
webView.evaluateJavaScript("document.body.scrollHeight", completionHandler: { [weak self] (result, error) in | |
if let height = result as? CGFloat { |
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 getBrightnessValue(from sampleBuffer: CMSampleBuffer) -> Float { | |
guard | |
let metadataDict = CMCopyDictionaryOfAttachments(nil, sampleBuffer, kCMAttachmentMode_ShouldPropagate) as? [String: Any], | |
let exifMetadata = metadataDict[String(kCGImagePropertyExifDictionary)] as? [String: Any], | |
let brightnessValue = exifMetadata[String(kCGImagePropertyExifBrightnessValue)] as? Float | |
else { return 0.0 } | |
return brightnessValue | |
} |
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
/* | |
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | |
* This product includes software developed at Datadog (https://www.datadoghq.com/). | |
* Copyright 2019-2020 Datadog, Inc. | |
*/ | |
import Foundation | |
public extension URLSession { | |
internal typealias RequestInterceptor = HookedSession.RequestInterceptor |
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 | |
extension CustomUrlProtocolRequestInterceptor: RequestInterceptor { | |
public func startRecording() { | |
URLProtocol.registerClass(CustormUrlProtocol.self) | |
swizzleProtocolClasses() | |
} | |
public func stopRecording() { | |
URLProtocol.unregisterClass(CustormUrlProtocol.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
OVERVIEW: Swift compiler | |
USAGE: swiftc [options] <inputs> | |
MODES: | |
-dump-ast Parse and type-check input file(s) and dump AST(s) | |
-dump-parse Parse input file(s) and dump AST(s) | |
-dump-scope-maps <expanded-or-list-of-line:column> | |
Parse and type-check input file(s) and dump the scope map(s) | |
-dump-type-refinement-contexts |
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
public extension UIDevice { | |
enum DeviceModelName: String { | |
case undefined | |
case iPodTouch5 | |
case iPodTouch6 | |
case iPhone4 | |
case iPhone4s | |
case iPhone5 |
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 | |
class CodeTextField: UITextField, UITextFieldDelegate { | |
let codeLength: Int | |
var characterSize: CGSize | |
var characterSpacing: CGFloat | |
let textPreprocess: (String) -> String | |
let validCharacterSet: CharacterSet |
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
// | |
// SRCopyableLabel.swift | |
// | |
// Created by Stephen Radford on 08/09/2015. | |
// Copyright (c) 2015 Cocoon Development Ltd. All rights reserved. | |
// | |
import UIKit | |
class SRCopyableLabel: UILabel { |
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
'use strict'; | |
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
LayoutAnimation, | |
} from 'react-native'; |
NewerOlder