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 is free and unencumbered software released into the public domain. | |
/// | |
/// Anyone is free to copy, modify, publish, use, compile, sell, or | |
/// distribute this software, either in source code form or as a compiled | |
/// binary, for any purpose, commercial or non-commercial, and by any | |
/// means. | |
/// | |
/// In jurisdictions that recognize copyright laws, the author or authors | |
/// of this software dedicate any and all copyright interest in the | |
/// software to the public domain. We make this dedication for the benefit |
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
Messaging.messaging().subscribe(toTopic: "REMOTE_CONFIG") { error in | |
if let error = error { | |
debugPrint("Could not subscribe to Remote Config topic", error) | |
} | |
} |
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
var expirationDuration: TimeInterval = 43200 // 12hs of cache by default | |
| |
if UserDefaults.standard.bool(forKey: "CONFIG_STATE") { | |
UserDefaults.standard.set(false, forKey: "CONFIG_STATE") | |
UserDefaults.standard.synchronize() | |
expirationDuration = 0 | |
} | |
| |
RemoteConfig.fetch(withExpirationDuration: expirationDuration) { [weak self] status, error in |
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
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (_: UIBackgroundFetchResult) -> Void) { | |
if userInfo["CONFIG_STATE"] != nil { | |
UserDefaults.standard.set(true, forKey: "CONFIG_STATE") | |
UserDefaults.standard.synchronize() | |
} | |
| |
completionHandler(UIBackgroundFetchResult.newData) | |
} |
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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
| |
admin.initializeApp(functions.config().firebase); | |
| |
exports.pushConfig = functions.remoteConfig.onUpdate(metadata => { | |
const payload = { | |
data: { | |
CONFIG_STATE: 'STALE' | |
} |
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
# -*- coding: utf-8 -*- | |
""" | |
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html | |
Original script: Ola Sitarska <[email protected]> | |
Improved version: Cristian Dinu <[email protected]> | |
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/ | |
The checking facility requires epubcheck: http://code.google.com/p/epubcheck/ | |
Embedding the 'Roots of Lisp' paper requires the programs ps2pdf and pdftoppm |