git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| // | |
| // NSWorkspace+ApplicationForOpeningURL.h | |
| // | |
| // Created by Scott Jackson on 10/07/12. | |
| // Copyright (c) 2012 SJSoftware. All rights reserved. | |
| // | |
| #import <Cocoa/Cocoa.h> | |
| @interface NSWorkspace (ApplicationForOpeningURL) |
| import Cocoa | |
| // https://github.com/DouglasHeriot/AutoGrowingNSTextField | |
| // for AutoLayout | |
| class AutoGrowingTextField: NSTextField { | |
| var minHeight: CGFloat? = 100 |
| NSShadow *textShadow = [[NSShadow alloc] init]; | |
| textShadow.shadowColor = [UIColor darkGrayColor]; | |
| textShadow.shadowBlurRadius = 1.2; | |
| textShadow.shadowOffset = CGSizeMake(1,1); | |
| NSDictionary *attributes = @{NSForegroundColorAttributeName: [UIColor blackColor], | |
| NSShadowAttributeName: textShadow | |
| }; | |
| // This extension is a port of @venj's solution from 2011 | |
| // https://github.com/venj/Cocoa-blog-code/blob/master/Round%20Corner%20Image/Round%20Corner%20Image/NSImage%2BRoundCorner.m | |
| extension NSImage { | |
| func roundCorners(withRadius radius: CGFloat) -> NSImage { | |
| let rect = NSRect(origin: NSPoint.zero, size: size) | |
| if | |
| let cgImage = self.cgImage, | |
| let context = CGContext(data: nil, |
Testing is helpful for ensuring that your code runs (driver code). This is to make sure that current features work, old features still work, and future work will be easily tested. By default, every Rails application has three environments: development, test, and production.
Rails offers three kinds of testing:
| import Alamofire | |
| func makeGetCallWithAlamofire() { | |
| let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1" | |
| Alamofire.request(todoEndpoint) | |
| .responseJSON { response in | |
| // check for errors | |
| guard response.result.error == nil else { | |
| // got an error in getting the data, need to handle it | |
| print("error calling GET on /todos/1") |
| #Works with Xcode 9 (Confirmed) | |
| #1. Go to "Edit Schemes" | |
| #2. Go to "Build" | |
| #3. Go to "Pre-Actions" | |
| #4. Select YOUR app in "Provide Build Settings from:" | |
| #5. Paste Below Script in Box | |
| #6. Build Project | |
| #Build Number ++ |
#Installing ngrok on OSX
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |