I hereby claim:
- I am mrtin on github.
- I am d6nomad (https://keybase.io/d6nomad) on keybase.
- I have a public key ASAF_eeHK6aYmUtu8db-4UX5A4P3fFOzxxy_rKSBuYqUDQo
To claim this, I am signing this object:
| // src/middleware.ts | |
| import { NextRequest, NextResponse } from 'next/server'; | |
| export const config = { | |
| matcher: '/:path*', | |
| }; | |
| export function middleware(req: NextRequest) { | |
| const basicAuth = req.headers.get('authorization'); | |
| const url = req.nextUrl; |
| // package.json | |
| { "pm2": "^5.2.0" } | |
| { "start:prod:cluster": "pm2-runtime start ecosystem.config.js --env production" } | |
| // ecosystem.config.js | |
| module.exports = { | |
| apps: [ | |
| { | |
| name: 'api', | |
| script: 'dist/src/main.js', |
| // https://www.apollographql.com/docs/apollo-server/data/errors/#unauthenticated | |
| // Using types and unions | |
| // https://blog.logrocket.com/handling-graphql-errors-like-a-champ-with-unions-and-interfaces/ | |
| // Wrap mutation with result{user, errors} | |
| // https://stackoverflow.com/a/55532706 | |
| // UserInputError | |
| // ValidationError |
| import { existsSync, createReadStream } from 'fs'; | |
| export const streamAgentLogToStdout = async ( | |
| filePath = '/tmp/appsignal.log', | |
| ) => { | |
| let totalLookups = 0; | |
| const lookupLimit = 10; | |
| const intervalObj = setInterval(function () { | |
| const fileExists = existsSync(filePath); | |
| totalLookups += 1; |
| class ApplicationController < ActiveRecord::Base | |
| self.abstract_class = true | |
| # Default order on :created_at instead of primary key | |
| self.implicit_order_column = :created_at | |
| end |
| # Enable extra metadata options by default | |
| [automount] | |
| enabled = true | |
| root = / | |
| options = "metadata,umask=22,fmask=11" | |
| mountFsTab = false |
| defmodule MyApp.Repo do | |
| require Logger | |
| use Ecto.Repo, | |
| otp_app: :my_app, | |
| adapter: Ecto.Adapters.Postgres | |
| def init(_type, config) do | |
| database_url = System.get_env("DATABASE_URL") | |
| if database_url == nil do | |
| Logger.debug "$DATABASE_URL not set, using config" |
| brew tap homebrew/versions | |
| brew install v8-315 | |
| gem install libv8 -v '3.16.14.15' -- --with-system-v8 | |
| gem install therubyracer -v '0.12.2' -- --with-v8-dir=/usr/local/opt/v8@3.15 | |
| bundle |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # Install directly using console: | |
| # bash <(curl -s https://gist.githubusercontent.com/MrTin/fa72909939e2752615caa4d272e944ef/raw) | |
| # Install dnsmasq | |
| brew install dnsmasq | |
| # Create config directory | |
| mkdir -pv $(brew --prefix)/etc/ |