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
// 2 - Build an app to list coffee drinks and display a detail page for each | |
// API: https://api.sampleapis.com/coffee/hot | |
// Flow: | |
// - App launch | |
// - Land on index screen with listing (fetched from API above). | |
// - Tap on coffee, launch detail screen | |
// - Show detail screen with image, title, ingredients, description | |
// - Back button | |
// | |
// |
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 | |
import XCTest | |
// Implementation | |
protocol TemperatureManagerDelegate: AnyObject { | |
func temperatureManager(_ temperatureManager: TemperatureManager, didUpdateTemperature temperature: Double) | |
} | |
class TemperatureManager { | |
weak var delegate: TemperatureManagerDelegate? |
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
# Assume we are in your home directory | |
cd ~/ | |
# Clone the repo from GitLab using the `--mirror` option | |
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git | |
# Change into newly created repo directory | |
$ cd ~/my-repo.git | |
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
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
# Go to local repo | |
cd /path/on/your/machine/my-repo | |
# Just update the remote | |
git remote set-url origin git@github.com:mario/my-repo.git |
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
"Something went wrong." message on web. Console error. qbo_receipt_error : function=createTxnForReceipt, error={"intuit_receipt_tid":"e28bbb19-5246-4c11-80f6-398626863bc6","response":[{"$type":"/Result","error":{"code":"10000","type":"SYSTEM_ERROR","message":"An application error has occurred while processing your request","exceptional":false,"$sdk_provider":"com.intuit.qbo.servicev4.transactions.providers.TransactionProvider"},"errors":[{"code":"10000","type":"SYSTEM_ERROR","message":"An application error has occurred while processing your request","exceptional":false,"$sdk_provider":"com.intuit.qbo.servicev4.transactions.providers.TransactionProvider"}]}],"body":[{"$type":"/integration/StageEntity","id":"djQuMToxMjMxNDYzOTkzODAyNDk6MDg4YWZjNDczYQ:94b2ca90-f1e9-11e9-be7e-ab5d5db7ada1","state":"ACCEPTED_ADDED","transactionTrait":{"transactionSource":"RECEIPT_UPLOAD","fiDescription":"Sprouts","transaction":{"$type":"/transactions/Transaction","meta":{"createdByApp":{"name":"Receipt Upload"}},"id":"-1","header" |
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 💩💩💩💩 { | |
func 💩💩💩(😎: Int, 🐯: Int) -> Int { | |
return 😎 + 🐯; | |
} | |
} | |
let 🐔 = 3; | |
let 😥 = 🐔 + 2; | |
let 💩 = 💩💩💩💩(); | |
print(💩.💩💩💩(😎:🐔, 🐯:😥)); // => "8\n" |
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
# Do not refactor, it is a bad practice. YOLO | |
# Not understanding why or how something works is always good. YOLO | |
# Do not ever test your code yourself, just ask. YOLO | |
# No one is going to read your code, at any point don't comment. YOLO | |
# Why do it the easy way when you can reinvent the wheel? Future-proofing is for pussies. YOLO |
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
module IntegerRefinements | |
refine Integer do | |
def to_s | |
'TWO, ALWAYS TWO!!!!' | |
end | |
end | |
end | |
class CrazyInteger | |
using IntegerRefinements |
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
# Our code calling `to_s` on an Integer has been refined | |
puts CrazyInteger.crazy_string(2) | |
# => "TWO, ALWAYS TWO!!!!" | |
puts CrazyInteger.crazy_string(3) | |
# => "TWO, ALWAYS TWO!!!!" | |
# Regular calls to Integer.to_s are still safe! | |
puts 1.to_s | |
# => "1" | |
puts 2.to_s |
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
module IntegerRefinements | |
refine Integer do | |
def to_s | |
'TWO, ALWAYS TWO!!!!' | |
end | |
end | |
end |
NewerOlder