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 | |
// A swift protocol can apply to a class, struct, or enum, | |
// but only a reference type can be stored in a `weak` var, | |
// so a weak var cannot be of a typical protocol type. | |
protocol MyProcotol { | |
} |
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
+ (NSArray *)allKeychainItems | |
{ | |
NSDictionary *queryDict = @{(__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword, | |
(__bridge id)kSecMatchLimit: (__bridge id)kSecMatchLimitAll, | |
(__bridge id)kSecReturnPersistentRef: (id)kCFBooleanTrue, | |
(__bridge id)kSecReturnAttributes: (id)kCFBooleanTrue, | |
(__bridge id)kSecReturnData: (id)kCFBooleanTrue | |
}; | |
CFTypeRef result = NULL; |
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/bash | |
CURL="/usr/bin/curl" | |
GAWK="/usr/bin/awk" | |
echo -n "Please pass the url you want to measure: " | |
read url | |
echo " Time_Connect Time_startTransfer Time_total " | |
while [ true ] | |
do | |
URL="$url" | |
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL` |
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
Time_Connect Time_startTransfer Time_total | |
0.607 74.332 74.586 *** | |
0.462 1.051 1.310 | |
0.127 0.878 1.129 | |
0.134 0.902 1.156 | |
0.096 0.173 0.173 | |
0.131 0.695 0.954 | |
0.127 0.528 0.793 | |
0.127 0.570 0.835 | |
0.126 0.689 0.944 |
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
Step 1. Download and install a browser extension that allows you to apply user styles to a page. | |
For Safari: | |
http://code.grid.in.th/ | |
For Chrome: | |
https://chrome.google.com/webstore/detail/fjnbnpbmkenffdnngjfgmeleoegfcffe | |
For Firefox: | |
https://addons.mozilla.org/en-US/firefox/addon/stylish/ |