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
kubectl create -f api-deployment.yaml |
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
# pvc.yaml | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: my-disk | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: |
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
kubectl create -f pvc.yaml |
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
... | |
@app.before_first_request | |
def _load_model(): | |
global MODEL | |
# Note: In GKE, health check triggers loading of the model | |
MODEL = load_model(_logger=app.logger) | |
@app.route('/healthz', methods=['GET']) | |
def health(): |
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
(function() { | |
/** | |
* Adds moving effect on scroll to elements with the `.scrollax` class. | |
* | |
* Optional `.sx-negative` class to move in opposite direction. | |
* | |
* @param {number} [antiMagnitude=40] Amount to reduce the magnitude of the effect by | |
* @version 1.2.0 | |
* @author Pat Migliaccio <[email protected]> | |
* @license MIT |
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
.body-overlay { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
z-index: 100000; | |
background: rgba(0, 0, 0, 0.7); | |
} |
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
// Trigger on opening of the modal. | |
function openModal() { | |
// Locks the body element from scrolling. | |
document.body.style.overflow = 'hidden'; | |
// Creates an overlay `div` element. | |
var overlay = document.createElement('div'); | |
// Adds a `.body-overlay` class to the `div` element. | |
overlay.classList.add('body-overlay'); | |
// Appends it to the body of the DOM | |
document.body.appendChild(overlay); |
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 fs = require('fs'); | |
const GOOGLE_APPLICATION_CREDENTIALS = 'keys/google_application_credentials.json'; | |
/** | |
* Adds secret keys from local JSON files as Base64 to `now` secrets. | |
* | |
* e.g. `node now-secrets-json.js' | |
*/ | |
function main() { |
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 resolvedActiveUsersFullComments = await Promise.all(activeUsersFullComments); |
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
5 users * 1 comment = 5 requests | |
5 users * 2 comments = 10 requests | |
5 users * 10 comments = 50 requests |