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 class UserAgent { | |
public static let userAgent: String? = { | |
guard let info = Bundle.main.infoDictionary, | |
let appNameRaw = info["CFBundleDisplayName"] ?? info[kCFBundleIdentifierKey as String], | |
let appVersionRaw = info[kCFBundleVersionKey as String], | |
let appName = appNameRaw as? String, | |
let appVersion = appVersionRaw as? String | |
else { return nil } | |
#if canImport(UIKit) |
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
[{ | |
"relation": [ | |
"delegate_permission/common.handle_all_urls" | |
], | |
"target": { | |
"namespace": "android_app", | |
"package_name": "com.yahoo.mobile.client.android.finance", | |
"sha256_cert_fingerprints": [ | |
"D3:F1:FB:1B:2C:81:E0:96:E3:F5:80:9A:50:3A:FD:A0:CF:AF:56:B9:D3:9D:ED:C6:56:EE:26:60:AC:EF:61:4C" | |
] |
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
#include <mach/mach_time.h> | |
NSURLSessionDataTask *task; | |
void(^doFetch)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error); | |
NSArray *smallImages = @[@"https://s.yimg.com/av/curveball/ads/pr/RESIZE/82x82/1342c899c7055c754f17a7e2d948330a.jpeg", | |
@"https://s.yimg.com/av/curveball/ads/pr/RESIZE/82x82/3c549674c2851a410348412ea45c2eab.jpeg", | |
@"https://s.yimg.com/av/curveball/ads/pr/RESIZE/82x82/85f1c40fe33d2234ec7d5c8bf01e3a25.jpeg", | |
@"https://s.yimg.com/av/curveball/ads/pr/RESIZE/82x82/eaa3b450578344d79f1a5ebec9dfdb70.jpeg", |
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
<? | |
if (!defined('RANDOM_COMPAT_READ_BUFFER')) { | |
define('RANDOM_COMPAT_READ_BUFFER', 8); | |
} | |
function random_bytes($bytes) | |
{ | |
static $fp = null; | |
/** |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, | |
NSURLCredential *credential))completionHandler | |
{ | |
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) | |
{ | |
[TSKPinningValidator handleChallenge:challenge completionHandler:completionHandler]; | |
} | |
else | |
{ | |
// This challenge was not for server trust. Fall back to default behavior. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>IDECodeSnippetCompletionScopes</key> | |
<array> | |
<string>All</string> | |
</array> | |
<key>IDECodeSnippetContents</key> | |
<string>#pragma clang diagnostic push |
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
# SSL request to hostname that is not in DNS | |
> curl -o /dev/null -w @curlformat https://beta.finance.yahoo.com | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 255k 0 255k 0 0 233k 0 --:--:-- 0:00:01 --:--:-- 233k | |
Size: 261255 | |
DNS: 0.522 | |
Connect: 0.536 |
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
// | |
// YFObjCUtils.c | |
// | |
// Created by Adam Kaplan on 7/31/15. | |
// Licensed under the MIT license. | |
// | |
@implementation UsageExample | |
- (void)usageMethod { |
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
// Missing 'result unused' warning demo | |
// Correct: expect.beNil(); | |
// Wrong: expect.beNil; | |
#import <Foundation/NSObject.h> | |
#define expect [EXPExpect new] | |
@interface EXPExpect : NSObject | |
- (void(^)(void)) beNil; |
NewerOlder