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
#### --------------------------------------------- | |
## Edit via: RStudio > Tools > Edit Code Snippets | |
# Released under a MIT license | |
snippet fragment | |
[${1:text}]{.${2:type}} | |
snippet aside | |
[${1:text}]{.aside} | |
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
// Assume you want to do this in your routes, which are in the critical path JS bundle | |
<Route path="lazy" loader={lazyLoader} element={<Lazy />} /> | |
// And assume you have two files containing your actual load and component: | |
// lazy-loader.ts -> exports the loader | |
// lazy-component.ts -> exports the component | |
// We'll render the component via React.lazy() | |
let LazyActual = React.lazy(() => import("./lazy-component")); |
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
library(shiny) | |
library(callr) | |
ui <- fluidPage( | |
titlePanel('Using callR in Shiny'), | |
actionButton('start_job', 'Start Expensive Job'), | |
tableOutput('result_table') | |
) |
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
So Github workflow for deploying a docker image to GCR, and subsequently pushing that to a cloud run instance is pretty easy | |
First just add your github tokens: | |
GCP_SERVICE_ID | |
GCP_PROJECT_ID | |
GCP_REGION <-- your services deploy region | |
GCP_SA_KEY <-- Follow the method in here (http://acaird.github.io/computers/2020/02/11/github-google-container-cloud-run) | |
Take note that my Dockerfile is specifically for an Express.js remix app, where Remix builds to `/server/build`. |
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
# TODO: Setup https://github.com/silvermine/serverless-plugin-cloudfront-lambda-edge | |
sentryOriginReq: | |
handler: handlers/handler.default | |
lambdaAtEdge: | |
distribution: AppDistribution | |
eventType: origin-request | |
includeBody: true | |
pathPattern: /_tunnel # TODO: Choose tunnel path. |
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
So you want to set up remix in cloud run huh? It's pretty simple but i'm going to assume you can figure out most of the GCP UI on your own. | |
Cloud Run: | |
Step 1: Create a new service and take note of the service ID | |
Step 2: Allow all traffic in the /triggers tab | |
Cloud Build: | |
Step 1: Set up a Cloud Build trigger on your repo | |
Step 2: Point the configuration to "cloud build configuration file" at the root of your project | |
Step 3: Add the following to the substitution variables (so you can keep it safe): |
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
version: "3.9" | |
services: | |
traefik: | |
image: traefik:latest | |
ports: | |
- 80:80 | |
- 443:443 | |
command: | |
- --api=true |
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
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
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
license: mit |