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
// Decorator adapted out of Angular 1.3.8 | |
// https://github.com/angular/angular.js/blob/v1.3.8/src/ng/rootScope.js#L196 | |
.config(['$provide', function($provide) { | |
// Minification-safe hack. | |
var $$watchers = '$$watchers', | |
$$nextSibling = '$$nextSibling', | |
$$childHead = '$$childHead', | |
$$childTail = '$$childTail', | |
$$listeners = '$$listeners', |
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
extension UILabel { | |
@IBInspectable var localizedKey: String? { | |
set { | |
if let s = newValue { | |
text = NSLocalizedString(s, comment:"") | |
} | |
} | |
get { | |
return text |
Service Worker - offline support for the web
- Service Worker - Revolution of the Web Platform
- The Service Worker is Coming - Look Busy (vid)
- Service Workers: Dynamic Responsive Images using WebP Images
- Is Service Worker ready?
Progressive apps - high-res icon, splash screen, no URL bar, etc.
@available(iOS 10.0, *)
import UserNotifications
NSUserNotification API Reference
UNNotificationSound API Reference
UNUserNotificationCenter API Reference
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
// src/config/dev.env.js | |
export default { | |
GOOGLE_MAPS_API_KEY: 'THE KEY' | |
} |
links for old versions of Docker for Mac
Docker provides download links in release note. They promised that
(we) will also include download links in release notes for future releases.
Note:
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
// Swift's untyped errors are a goddam PiTA. Here's the pattern I use to try to work around this. | |
// The goal is basically to try to guarantee that every throwing function in the app throws an | |
// ApplicationError instead of some unknown error type. We can't actually enforce this statically | |
// But by following this convention we can simplify error handling | |
enum ApplicationError: Error, CustomStringConvertible { | |
// These are application-specific errors that may need special treatment | |
case specificError1 | |
case specificError2(SomeType) |
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
data class SimpleDemoState(val listing: Async<Listing> = Uninitialized) | |
class SimpleDemoViewModel(override val initialState: SimpleDemoState) : MvRxViewModel<SimpleDemoState>() { | |
init { | |
fetchListing() | |
} | |
private fun fetchListing() { | |
// This automatically fires off a request and maps its response to Async<Listing> | |
// which is a sealed class and can be: Unitialized, Loading, Success, and Fail. |
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
/** | |
UPDATE: | |
This component and hook based routing/fetching API won't work, as `useAsync()` | |
is an impossible component. | |
In order to use async functions to respond to route changes, the functions will | |
need to be registered with a parent cache/provider with a unique key. As such, a | |
more natural component-based architecture would involve a `<Route path>` component |