-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated examples to use 0.3 features (#10)
* added environment and async/awailt in hummingbird demo * added async to vapor examples
- Loading branch information
Showing
6 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
actor BonusFactStore { | ||
// courtesy of chatchipitty | ||
let bonusFacts = [ | ||
"Writing code is 10% typing and 90% figuring out why you typed it that way in the first place.", | ||
"The hardest part of programming isn't coding — it's naming variables without sounding ridiculous.", | ||
"If code comments are the breadcrumbs, then debugging is following a very messy trail of pizza crumbs.", | ||
"Optionals in Swift are a nice way of saying, 'Yeah, I have no idea what might happen here.'", | ||
"You can fix 99% of your bugs by turning it off and back on. The other 1%? Crying helps.", | ||
"Programmers don't sleep. They just enter a low-power mode with their eyes open.", | ||
"In the world of code, everything is either a `true`, `false`, or 'maybe, if you handle this optional safely.'", | ||
"Any code that hasn't been touched in more than six months is officially considered 'legacy code.'", | ||
] | ||
|
||
func calculateBonusFact() async -> String { | ||
return bonusFacts.randomElement()! | ||
} | ||
|
||
@TaskLocal static var current: BonusFactStore? | ||
} |
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
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
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