Skip to content

Instantly share code, notes, and snippets.

@lukebussey
lukebussey / SKILL.md
Created February 26, 2026 20:19
Punctuation Skill
name description
punctuation
Converts straight quotes to typographic quotes, normalizes hyphens/dashes and ellipsis in prose copy. Use when editing marketing copy, blog posts, landing pages, docs, or when the user asks to fix quotation marks, dashes, or ellipsis.

Punctuation

Goal

Convert straight quotes, hyphens/dashes, and ellipsis to correct typographic characters in prose. Do not change code blocks, inline code, commands, or file paths unless explicitly requested.

@lukebussey
lukebussey / PostgresFunctionsCheatsheetReadme.md
Created January 11, 2022 18:15 — forked from dantheman213/PostgresFunctionsCheatsheetReadme.md
PostgreSQL & PL/pgSQL Stored Functions Cheatsheet

PostgreSQL & PL/pgSQL Stored Functions Cheatsheet

Boiler-plate stored function

CREATE OR REPLACE FUNCTION public.sp_user_ins_status(status smallint)
  RETURNS integer
  LANGUAGE plpgsql
AS $function$

To embed the contents of an SVG file into your site using NextJS with the new Rust-based compiler (Turbopack), perform the following steps:

  1. Install @svg/webpack:
$ npm install --save-dev @svgr/webpack
  1. Add to your webpack config in next.config.js with the following options. This will remove the width and height from the SVG but keep the viewBox for correct scaling.
import PropTypes from 'prop-types';
import { useState, useEffect, useContext, createContext } from 'react';
import { useRouter } from 'next/router';
import merge from 'deepmerge';
import usePrevious from 'hooks/usePrevious';
const useProvideSegment = () => {
const [location, setLocation] = useState();
const router = useRouter();
var cookieVal = document.cookie,
testVal = "mixpanel",
localStorageKey = "mixpanel-cookie",
canWriteCookie = false;
// Test cookie
document.cookie = testVal;
canWriteCookies = document.cookie === testVal;
// Restore cookie
const Sitemapper = require('sitemapper');
(async () => {
const mapper = new Sitemapper();
const sitemap = await mapper.fetch(`https://www.example.com/sitemap.xml`);
console.log(sitemap);
})();
@lukebussey
lukebussey / functions.php
Created February 21, 2020 23:35
Add Custom Font Formats to Divi 4
/* Mime Types Support */
add_filter('upload_mimes', 'custom_mime_types', 999999);
function custom_mime_types($mimes) {
$mimes['otf'] = 'application/x-font-opentype';
$mimes['woff'] = 'application/font-woff';
$mimes['woff2'] = 'application/font-woff2';
return $mimes;
}
/* Custom Font Types Support */
sub vcl_recv {
if (req.http.host == "domain.com" && req.url.path == "/user") {
error 601 "user";
}
}
sub vcl_error {
if (obj.status == 601) {
set obj.http.Content-Type = "text/json";
set obj.status = 200;
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt -reqexts SAN -extensions SAN \
-config <(cat /System/Library/OpenSSL/openssl.cnf \
<(printf '[SAN]\nsubjectAltName=DNS:*.local'))
npm list -g --depth=0