This file contains hidden or 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
class CatalogExportingTests: XCTestCase { | |
var container: NSPersistentContainer! | |
override func setUp() { | |
guard | |
let managedObjectModelURL = | |
Bundle(for: Self.self).url( | |
forResource: "GoShopping", | |
withExtension: "momd" |
This file contains hidden or 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
class RefactoredCatalogExportingTests: XCTestCase { | |
func test_Categories_Are_Exported_By_DisplayOrder() { | |
let fooCategory = CatalogCategory2(displayOrder: 1, name: "Foo") | |
let barCategory = CatalogCategory2(displayOrder: 2, name: "Bar") | |
let stubCatalog = StubCatalog(stubs: [fooCategory, barCategory]) | |
let catalogExporter = CatalogExporter() | |
let exportedCatalog = catalogExporter.export(stubCatalog) | |
XCTAssertEqual(exportedCatalog.count, 2) |
This file contains hidden or 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 | |
class WelcomeViewController: UIViewController { | |
override func loadView() { | |
let view = UIView(frame: .zero) | |
view.backgroundColor = .systemBackground | |
let title = makeTitleLabel() |
This file contains hidden or 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 | |
class WelcomeViewController: UIViewController { | |
override func loadView() { | |
let view = UIView(frame: .zero) | |
view.backgroundColor = .systemBackground | |
let title = makeTitleLabel() |
This file contains hidden or 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 <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
@end | |
@interface Foo (UndefinedBehaviour) | |
- (void)foo:(id)foo bar:(id)bar; |
This file contains hidden or 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
IP=10.0.1.18 | |
for f in *; do | |
echo ">>> Uploading $f <<<" | |
curl \ | |
--progress-bar \ | |
--form "files[]=@$f" \ | |
http://"$IP"/upload.json \ | |
| tee -a vlc-ios-upload.log; test ${PIPESTATUS[0]} -eq 0 |
This file contains hidden or 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
export rvm_project_rvmrc_default=1 | |
export rvm_pretty_print_flag=auto | |
rvm_with_gems="cocoapods" | |
rvm_with_default_gems="cocoapods" |
This file contains hidden or 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
readonly GIT_CORE='/Applications/Xcode.app/Contents/Developer/usr/share/git-core' | |
readonly GIT_BASH_COMPLETION="$GIT_CORE/git-completion.bash" | |
readonly GIT_PS1="$GIT_CORE/git-prompt.sh" | |
[ -f "$GIT_BASH_COMPLETION" ] && source "$GIT_BASH_COMPLETION" | |
if [ -f "$GIT_PS1" ] ; then | |
source "$GIT_PS1" | |
export PS1='[\A] $(tput setaf 2)\u$(tput sgr0):\w$(tput setaf 1)$(__git_ps1 " (%s)")$(tput sgr0) $ ' | |
else | |
export PS1="[\A] $(tput setaf 2)\u$(tput sgr0):\w $ " |
This file contains hidden or 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 CoreData | |
func newManagedObjectModel() -> NSManagedObjectModel { | |
// you get new instance of MOM with the same properties | |
// each time you call the function. | |
// this function uses entity description returned by | |
// newEntityDescription function | |
} | |
func newEntityDescription() -> NSEntityDescription { |
This file contains hidden or 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
enum JSON { | |
indirect case Object([Swift.String: JSON]) | |
indirect case Array([JSON]) | |
case String(Swift.String) | |
case Number(Int) | |
case Boolean(Bool) | |
case Null | |
} | |
let json = JSON.Object(["foo": JSON.String("bar")]) |
NewerOlder