View inital_test.swift
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
class CatalogExportingTests: XCTestCase { | |
var container: NSPersistentContainer! | |
override func setUp() { | |
guard | |
let managedObjectModelURL = | |
Bundle(for: Self.self).url( | |
forResource: "GoShopping", | |
withExtension: "momd" |
View refactored_test.swift
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
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) |
View WelcomeViewController.swift
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 | |
class WelcomeViewController: UIViewController { | |
override func loadView() { | |
let view = UIView(frame: .zero) | |
view.backgroundColor = .systemBackground | |
let title = makeTitleLabel() |
View WelcomeViewController.swift
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 | |
class WelcomeViewController: UIViewController { | |
override func loadView() { | |
let view = UIView(frame: .zero) | |
view.backgroundColor = .systemBackground | |
let title = makeTitleLabel() |
View UB.h
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 <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
@end | |
@interface Foo (UndefinedBehaviour) | |
- (void)foo:(id)foo bar:(id)bar; |
View vlc-ios-upload.sh
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
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 |
View .rvmrc
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
export rvm_project_rvmrc_default=1 | |
export rvm_pretty_print_flag=auto | |
rvm_with_gems="cocoapods" | |
rvm_with_default_gems="cocoapods" |
View .bashrc
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
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 $ " |
View mom + psc issue.swift
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 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 { |
View json.swift
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
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