Skip to content

Instantly share code, notes, and snippets.

View phoward38's full-sized avatar

Patrick Howard phoward38

View GitHub Profile
#### ---------------------------------------------
## Edit via: RStudio > Tools > Edit Code Snippets
# Released under a MIT license
snippet fragment
[${1:text}]{.${2:type}}
snippet aside
[${1:text}]{.aside}
@brophdawg11
brophdawg11 / App.jsx
Created July 29, 2022 14:03
React Router 6.4.0 Code Splitting Example
// 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"));
@hypebright
hypebright / shiny_callR_demo.R
Last active January 23, 2024 11:15
Small demo to use background processes in Shiny apps with callR
library(shiny)
library(callr)
ui <- fluidPage(
titlePanel('Using callR in Shiny'),
actionButton('start_job', 'Start Expensive Job'),
tableOutput('result_table')
)
@TheRealFlyingCoder
TheRealFlyingCoder / . Github Actions: Remix + Cloud Run + Docker
Last active November 12, 2024 17:45
Github Actions: Remix + Cloud Run + Docker
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`.
@razor-x
razor-x / functions.yaml
Last active May 3, 2024 12:39
Sentry.io CloudFront Lambda@Edge tunnel
# 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.
@TheRealFlyingCoder
TheRealFlyingCoder / Cloud Run & Remix
Last active February 14, 2025 00:19
Remix & Cloud Run
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):
@acouvreur
acouvreur / docker-compose.yml
Last active September 1, 2024 15:10
Traefik with HTTPS (with redirect and wildcard certificate) and Host rule autoconfiguration (for docker swarm)
version: "3.9"
services:
traefik:
image: traefik:latest
ports:
- 80:80
- 443:443
command:
- --api=true
@d3noob
d3noob / .block
Last active November 23, 2024 20:25
Collapsible tree diagram in v7
license: mit
@d3noob
d3noob / .block
Created June 19, 2021 01:50
Tree diagram from csv using v7
license: mit
@d3noob
d3noob / .block
Created June 19, 2021 01:46
Tree diagram loading external json with v7
license: mit