Skip to content

Instantly share code, notes, and snippets.

View lacymorrow's full-sized avatar
🕶️
Grok'ing

Lacy Morrow lacymorrow

🕶️
Grok'ing
View GitHub Profile
@lacymorrow
lacymorrow / CheatSheet.md
Last active March 27, 2024 20:08
Shell Cheat Sheet
# https://yurisk.info/2023/03/28/mdfind-macos-examples-cheat-sheet
# Find files where filename includes string (case-insensitive)
mdfind -name ...

# Find folders where name includes string (case-insensitive)
mdfind -name ... kind:folder

# See where an alias was defined
@lacymorrow
lacymorrow / loading_messages.js
Created January 8, 2024 00:08 — forked from meain/loading_messages.js
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@lacymorrow
lacymorrow / best-practices.md
Created November 2, 2023 18:29
Javascript Dev Best Practices

Best Practices for Good Javascript

These are personal observations I keep for myself

Naming

Name your files like-this.file or likeThis.file, dashes allow you to delete one word at a time, camelCase allows IDE snippets to automatically scaffold the name.

Debugging

@lacymorrow
lacymorrow / prettyCamelCase.js
Created August 9, 2023 21:49
JS function to format a camelCase string into a "Camel Case" pretty string
function prettyFormat(str) {
return str.split(/(?=[A-Z])/)
.map(function(word) {
return word.charAt(0).toUpperCase() + word.slice(1);
})
.join(' ');
}
@lacymorrow
lacymorrow / vscode-bug.ts
Created July 20, 2023 21:03
VSCode Bug
import { cache } from 'react';
export const getBaseUrl = cache(() =>
process.env.VERCEL_URL
? `https://app-dir.vercel.app`
: `http://localhost:${process.env.PORT ?? 3000}`,
);
import { cache } from 'react';
export const getBaseUrl = cache(() =>
process.env.VERCEL_URL
? `https://app-dir.vercel.app`
: `http://localhost:${process.env.PORT ?? 3000}`,
);
@lacymorrow
lacymorrow / Add an app to run automatically at startup in Windows 10
Created May 28, 2023 22:46
Add an app to run automatically at startup in Windows 10
Windows 10
Select the Start button and scroll to find the app you want to run at startup.
Right-click the app, select More, and then select Open file location. This opens the location where the shortcut to the app is saved. If there isn't an option for Open file location, it means the app can't run at startup.
With the file location open, press the Windows logo key + R, type shell:startup, then select OK. This opens the Startup folder.
Copy and paste the shortcut to the app from the file location to the Startup folder.
@lacymorrow
lacymorrow / text-to-image.php
Created May 24, 2023 03:34
Uses an uploaded font to change text into an image.
<?php
// Copyright (c) 2005, Lacy Morrow
// All rights reserved.
// ******************Text-Image PHP Script***********************
// Uses an uploaded font to change text into an image. Multiple options.
// USE:
// ONLY SUPPORTS .ttf fonts
// Use the format "http://www.yourdomain.com/text.php?s=11&text=hello&font=TIMES"
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"meta": {
"theme": "kendall",
"version": "v1.0.0",
"canonical": "https://github.com/jsonresume/resume-schema/blob/v1.0.0/schema.json"
},
"basics": {
"name": "Lacy Morrow",
"label": "Senior Web Engineer",
// Run `openssl rand -base64 32` or https://generate-secret.vercel.app/32 to generate a secret