#Installing ngrok on OSX
- Download ngrok
- Unzip it to your Applications directory
- Create a symlink (instructions below)
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory| import { useLoaderData, Link, useSearchParams } from 'remix'; | |
| import { parseISO, format } from 'date-fns'; | |
| import groupBy from 'lodash/groupBy'; | |
| let PAGE_SIZE = 5; | |
| function safeParseInt(str) { | |
| let parsed = parseInt(str); | |
| return isNaN(parsed) ? 0 : parsed; | |
| } |
| import { createHash } from "crypto"; | |
| import fs from "fs"; | |
| import fsp from "fs/promises"; | |
| import path from "path"; | |
| import https from "https"; | |
| import { PassThrough } from "stream"; | |
| import type { Readable } from "stream"; | |
| import type { LoaderFunction } from "remix"; | |
| import sharp from "sharp"; | |
| import type { Request as NodeRequest } from "@remix-run/node"; |
| { | |
| "name": "remove-ts", | |
| "version": "1.0.0", | |
| "description": "I use this to automatically fix feedback links in my workshops", | |
| "bin": "./remove-ts.js", | |
| "dependencies": { | |
| "@babel/core": "7.13.8", | |
| "@babel/preset-typescript": "7.13.0", | |
| "glob": "7.1.6" | |
| } |
| import NextHead from 'next/head' | |
| import React from 'react' | |
| import ReactGA from 'react-ga' | |
| import Router from 'next/router' | |
| // GA Tracking Id | |
| const gaTrackingId = '[GOOGLE ANALYTICS TRACKING ID GOES HERE]' | |
| Router.onRouteChangeComplete = () => { |
| *[class], | |
| *[id] { | |
| position: relative; | |
| outline: 2px dashed red; | |
| &::before, | |
| &::after { | |
| position: absolute; | |
| top: 0; | |
| left: 0; |
#Installing ngrok on OSX
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory| import * as React from 'react' | |
| import { createPortal } from 'react-dom' | |
| type FrameProps = React.IframeHTMLAttributes<HTMLIFrameElement> & { | |
| head?: React.ComponentType<any> | |
| children?: React.ReactNode | |
| } | |
| const Frame = React.memo(({head, children, ...iframeProps}: FrameProps)=> { | |
| const node = React.useRef<HTMLIFrameElement>() | |
| const [doc, setDoc] = React.useState<Document>() |
| // the main app file | |
| import express from "express"; | |
| import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
| import authenticate from "./authentication"; // middleware for doing authentication | |
| import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
| const app = express(), | |
| api = express.Router(); | |
| // first middleware will setup db connection |
| // | |
| // ContentView.swift | |
| // Widgets | |
| // | |
| // Created by Kyle Halevi on 7/3/20. | |
| // | |
| import SwiftUI | |
| struct Widget: View { |
| import { useCallback, useLayoutEffect, DependencyList } from 'react' | |
| /** | |
| * This version bounces each version of the callback. This ensures that the callback | |
| * will be called with each state of the application. That's why `deps` is a required argument. | |
| * | |
| * Previous version used `useRef` for `timeoutId` and didn't have `deps` argument. | |
| * This resulted in missing calling the callback for the previous state and necessarily | |
| * calling it for the new state. | |
| * |