# EDITOR=nano sudo visudo | |
# Change the following line: (:i to insert + esc to go back + :w to save + :q to quit) | |
# Defaults env_reset | |
# to: | |
# Defaults env_reset,timestamp_timeout=960 # in minutes | |
export PATH=$PATH:. | |
# export PATH=$PATH:/usr/bin |
source ~/.bash_profile | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 | |
fi |
import Foundation | |
extension Array | |
{ | |
/** Randomizes the order of an array's elements. */ | |
mutating func shuffle() | |
{ | |
for _ in 0..<10 | |
{ | |
sort { (_,_) in arc4random() < arc4random() } |
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute the following when inside your target project: | |
find . -name "*.swift" -print0 | xargs -0 wc -l |
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
- Encapsulation
- Access control
<!-- | |
This disables app transport security and allows non-HTTPS requests. | |
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better | |
approach is to fix the non-secure resources. However, this patch will work in a pinch. | |
To apply the fix in your Ionic/Cordova app, edit the file located here: | |
platforms/ios/MyApp/MyApp-Info.plist | |
And add this XML right before the end of the file inside of the last </dict> entry: |
You need to have SketchTool installed somewhere in your path.
Add this in your ~/.gitconfig
file (for some reason, it won't work in a local .gitconfig file):
import UIKit | |
import Photos | |
extension PHPhotoLibrary { | |
// MARK: - PHPhotoLibrary+SaveImage | |
// MARK: - Public | |
func savePhoto(image:UIImage, albumName:String, completion:((PHAsset?)->())? = nil) { | |
func save() { |
Linkdin (of all companies) published a shocking blog today on the performance of Swift build times. They claim that their project compiles faster on their lower speced MacBook Pros (and even a Mac mini) than their 12 core Mac Pros. Even though the Mac Pro is 4 years out of date, the raw number of cores gives it quit an advantage over the 4 core MacBook Pro and especially the 2 core Mac mini. What's even more shocking, is that when they lowered the number of threads available to the compiler, their build times actually went up. It's an interesting article and worth reading. I decided to test their numbers with my own project.
First, I tried building from the command line, cleaning each time to get consistent results:
time xcodebuild -workspace Engagement.xcworkspace -scheme Engagement -sdk iphoneos -configuration Debug clean build | xcpretty