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
"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
# 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 | |
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
module IntegerRefinements | |
refine Integer do | |
def to_s | |
'TWO, ALWAYS TWO!!!!' | |
end | |
end | |
end |
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
irb(main):001:0> 1.class | |
=> Integer | |
irb(main):002:0> 1.to_s | |
=> "1" | |
irb(main):003:0> class Integer | |
irb(main):004:1> def to_s | |
irb(main):005:2> "two" | |
irb(main):006:2> end | |
irb(main):007:1> end | |
=> :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
<a onafterprint="console.log(244599)" onbeforeprint="console.log(309354)" onbeforeunload="console.log(879813)" onerror="console.log(949564)" onhashchange="console.log(575242)" onload="console.log(301053)" onmessage="console.log(976974)" onoffline="console.log(796090)" ononline="console.log(432638)" onpagehide="console.log(504345)" onpageshow="console.log(696619)" onpopstate="console.log(398418)" onresize="console.log(943097)" onstorage="console.log(882233)" onunload="console.log(929443)" onblur="console.log(932104)" onchange="console.log(102339)" oncontextmenu="console.log(761265)" onfocus="console.log(188946)" oninput="console.log(143653)" oninvalid="console.log(304208)" onreset="console.log(318472)" onsearch="console.log(778420)" onselect="console.log(942035)" onsubmit="console.log(603589)" onkeydown="console.log(650647)" onkeypress="console.log(579383)" onkeyup="console.log(821763)" onclick="console.log(284098)" ondblclick="console.log(477370)" ondrag="console.log(439095)" ondragend="console.log(546684)" o |
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
require "http/client" | |
class Word | |
def initialize(word) | |
raise ArgumentError.new "Not a single word" if word.split(" ").size > 1 | |
@word = word | |
end | |
def wiki_title | |
wiki_page = WikipediaPage.new(@word) |
NewerOlder