Skip to content

Instantly share code, notes, and snippets.

View mguay22's full-sized avatar

Michael Guay mguay22

View GitHub Profile
import { UnauthorizedException } from '@nestjs/common';
import { app } from './app';
import { ClientProxy } from '@nestjs/microservices';
import { AUTH_SERVICE } from '@app/common';
import { lastValueFrom } from 'rxjs';
const publicRoutes = ['/public-route', '/another-public-route'];
export const authContext = async ({ req }) => {
// Check if the request path is in the list of public routes
@mguay22
mguay22 / node-local-dns.sh
Created March 29, 2022 23:44
Node Local DNS Cache Installation
curl -sL https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml \
| sed -e 's/__PILLAR__DNS__DOMAIN__/cluster.local/g' \
| sed -e "s/__PILLAR__DNS__SERVER__/$(kubectl get service --namespace kube-system kube-dns -o jsonpath='{.spec.clusterIP}')/g" \
| sed -e 's/__PILLAR__LOCAL__DNS__/169.254.20.10/g' \
| kubectl apply -f -
@mguay22
mguay22 / functions.php
Created June 30, 2017 02:56
Custom WordPress Metabox
add_action( 'add_meta_boxes', 'mg_mb_create' );
function mg_mb_create() {
add_meta_box( 'mg-meta', 'My Custom Meta Box', 'mg_mb_function', 'post', 'normal', 'high' );
}
function mg_mb_function( $post ) {
// Retrieve the metadata values if they exist.