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
# WiFi: On | |
sudo profiles show -type enrollment | |
# Take note of domains used for enrollment | |
# WiFi: Off | |
sudo profiles remove -all | |
# Restart: Recovery Mode | |
csrutil disable; reboot |
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
module.exports = { | |
root: true, | |
parser: '@typescript-eslint/parser', | |
extends: [ | |
'next/core-web-vitals', | |
'plugin:@typescript-eslint/recommended', | |
'plugin:prettier/recommended', | |
'prettier', | |
], | |
plugins: ['jest', '@typescript-eslint', 'prettier'], |
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
import { OAuthConfig, OAuthUserConfig } from 'next-auth/providers'; | |
import getConfig from 'next/config'; | |
const { publicRuntimeConfig } = getConfig(); | |
export interface BoltProfile extends Record<string, any> { | |
profile: Profile; | |
addresses: Address[]; | |
// payment_methods: PaymentMethod[]; # TODO: Implement... | |
has_bolt_account: boolean; |
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
name: Enforce PR Title Style | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened] | |
jobs: | |
enforce_pr_title: | |
name: Enforce PR Title Style | |
runs-on: ubuntu-latest | |
steps: |
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
namespace :dev do | |
namespace :db do | |
desc 'Reset database and import production data' | |
task restore_from_prod: :environment do | |
unless Rails.env.development? | |
puts("This task is only available in development") | |
next | |
end | |
tmp_path = Rails.root.join("tmp") |
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
await new Promise(res => setTimeout(res, 1200)); |
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
import { ExecutionContext, Injectable } from '@nestjs/common'; | |
import { AuthGuard } from '@nestjs/passport'; | |
import { GqlExecutionContext } from '@nestjs/graphql'; | |
// import { UserService } from 'src/user/user.service'; | |
@Injectable() | |
export class GqlAuthGuard extends AuthGuard('jwt') { | |
// constructor(@Inject(UserService) private readonly userService: UserService) { | |
// super(); | |
// } |
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
// 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; |
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
// 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', |
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
// 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 |
NewerOlder