Skip to content

Instantly share code, notes, and snippets.

https://polyfill.io/v3/polyfill.js?features=Element.prototype.classList%2Cdocument.querySelector%2CNode.prototype.contains%2CElement.prototype.remove%2Cdocument%2CNumber.MAX_SAFE_INTEGER%2CNumber.MIN_SAFE_INTEGER
wp_register_script('name', 'path/to/script.js');
$array = array(
'poop' => 'yes, please',
'pee' => 'would prefer poop'
);
wp_localize_script('name', 'js_object_name', $array);
# Install dependencies
FROM node:16 AS dependencies
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Run yarn build
FROM node:16 AS builder
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
@mcorkum
mcorkum / [...nextauth].ts
Created May 5, 2023 18:19
Microsoft ADFS Provider for Resource in Next Auth with Types
// Import the required packages
import NextAuth, { NextAuthOptions } from 'next-auth';
import { JWT } from 'next-auth/jwt';
import jwt_decode from 'jwt-decode'; // Used for decoding the accessToken in account
// Define the types for the profile
interface ProfileProps {
aud: string;
iss: string;
iat: number;
@mcorkum
mcorkum / test.json
Last active July 13, 2023 02:32
WordPress - Overriding Gutenberg text strings with translations
{
"domain": "messages",
"locale_data": {
"messages": {
"": {
"domain": "messages"
},
"This block contains unexpected or invalid content.": [
"Poop, this block sucks now"
]