- 开启ipv4转发
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
- 安装dnsmasq 和pdnsd解决dns污染
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
| // To check if a number is between a range, don't do | |
| if number >=0 && number <= 100 { | |
| } | |
| // Use range and news operators instead : | |
| if 0...100 ~= number { | |
| } |
| import Cocoa | |
| import Foundation | |
| var str = "Hello, playground" | |
| var task:NSTask = NSTask() | |
| var pipe:NSPipe = NSPipe() | |
| task.launchPath = "/bin/ls" | |
| task.arguments = ["-la"] |
Here are the steps that should work for you:
This steps are copied from pocketlogic's answer at StackOverflow
| <?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>Label</key> | |
| <string>Jenkins</string> | |
| <key>KeepAlive</key> | |
| <true/> | |
| <key>ProgramArguments</key> | |
| <array> |
| // UIWebView | |
| { | |
| UIWebView *webView = [[UIWebView alloc] init]; | |
| [webView loadHTMLString:@"<html></html>" baseURL:nil]; | |
| NSString *appName = [webView stringByEvaluatingJavaScriptFromString:@"navigator.appName"]; | |
| NSLog(@"%@", appName); | |
| // Netscape | |
| NSString *userAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"]; |
| http://devstreaming.apple.com/videos/wwdc/2015/217wu453thu1r1/217/217_hd_adopting_new_trackpad_features.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2267p2ni281ba/226/226_hd_advanced_nsoperations.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/233l9q8hj9mw/233/233_hd_advanced_touch_input_on_ios.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/224o6pqmtb4ik/224/224_hd_app_extension_best_practices.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2048w4vdjhe1i1m/204/204_hd_apple_watch_accessibility.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/232f1zopzycv/232/232_hd_best_practices_for_progress_reporting.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/213w6grumlfm0q/213/213_hd_building_apps_with_researchkit.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/234reaz1byqc/234/234_hd_building_document_based_apps.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2313dt427pmq/231/231_hd_cocoa_touch_best_practices.mp4?dl=1 | |
| http://devstreaming.apple.com/vide |
PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug
Speaker: David Abrahams. (Tech lead for Swift standard library)
"Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.
OOP has been around since the 1970's. It's not actually new.
Classes are Awesome
| // | |
| // FileUploader.swift | |
| // | |
| // Copyright (c) 2015 Narciso Cerezo Jiménez. All rights reserved. | |
| // Largely based on this stackoverflow question: http://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire/28467829// | |
| import Foundation | |
| import Alamofire | |
| private struct FileUploadInfo { |