Skip to content

Instantly share code, notes, and snippets.

View ThatGuySam's full-sized avatar
🍉
Discovering the wonders of JAMStack

Sam Carlton ThatGuySam

🍉
Discovering the wonders of JAMStack
View GitHub Profile
function getURLType ( url ) {
if (url.match(/Youtube URL Regex/g)) return 'youtube'
if (url.match(/MP4 URL Regex/g)) return 'mp4'
// Otherwise
return 'image'
}
const urlType = getURLType (url)
@ThatGuySam
ThatGuySam / release-notes.txt
Created February 16, 2021 18:01
DisplayLink Manager Release Notes 1.3.0
=============================================================================
=============================================================================
DisplayLink macOS Application Release Note
Version: v1.3.0
Build: posix/55-8038-gfe36308bc9e (111)
Date: 1st February 2021
@ThatGuySam
ThatGuySam / get-font-variations-used.js
Created April 5, 2021 20:01
Find all unique font weight and style combinations in Javascript
const fontVariationsUsed = new Set()
Array.from(document.querySelectorAll('*')).forEach( element => {
const computedStyle = window.getComputedStyle( element )
const hasFontFamily = computedStyle.fontFamily.includes('Montserrat')
if ( hasFontFamily ) {
// Add variation to list
fontVariationsUsed.add(`${computedStyle.fontWeight} ${computedStyle.fontStyle}`)
@ThatGuySam
ThatGuySam / grecatpcha.js
Created April 6, 2021 20:42
Google Recaptcha V3 ES Module feat Netlify and Axios
// .env
// CAPTCHA_SITE='...'
// CAPTCHA_SECRET='...'
import axios from 'axios'
// https://github.com/dlqs/serverless-captcha/blob/master/functions/captcha.js
export const scriptUrl = `https://www.google.com/recaptcha/api.js?render=${process.env.CAPTCHA_SITE}&onload=onRecaptchaLoadCallback`
@ThatGuySam
ThatGuySam / styleguide.js
Last active February 7, 2022 16:42
Tailwind Style Guide Template
module.exports = {
purge: false,
theme: {
extend: {
colors: {
// The Words - Medium Black
medium_black: 'rgb(38, 38, 38)',
// The Canvas - White,
white: 'rgb(255, 255, 255)',
@ThatGuySam
ThatGuySam / Presentation-Checklist.md
Last active March 9, 2022 22:57
Techlahoma Presentation Checklist

Presentation Checklist

You can use these checklists to ensure as few technical difficulties as possible so all your hard work is presented in the best way and without any distractions.

In-Person Presentations

45 mins before event start

@ThatGuySam
ThatGuySam / upload.xml
Created April 12, 2022 20:21
Youtube PubSub Non-live Upload Body Example
<?xml version='1.0' encoding='UTF-8'?>
<feed
xmlns:yt="http://www.youtube.com/xml/schemas/2015"
xmlns="http://www.w3.org/2005/Atom">
<link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<link rel="self" href="https://www.youtube.com/xml/feeds/videos.xml?channel_id=UCB3jOb5QVjX7lYecvyCoTqQ"/>
<title>YouTube video feed</title>
<updated>2022-04-12T20:18:12.634792044+00:00</updated>
<entry>
<id>yt:video:UTVZ7IQ2Ggg</id>
@ThatGuySam
ThatGuySam / subs.md
Created June 28, 2022 19:59
Download YouTube Video Subtitles
youtube-dl --write-auto-sub --sub-lang en --sub-format best --skip-download "https://www.youtube.com/watch?v=-qU6w9jqk94"
@ThatGuySam
ThatGuySam / make-env-example.js
Last active December 16, 2022 21:22
Node script for securely keeping .env in sync with .env.example
// Can be used with Run on Save - https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave
// Manually run with `npx tsx ./make-env-example.ts`
import { promises as fs } from 'node:fs'
( async () => {
// Read the .env file
const envContent = await fs.readFile( '.env', 'utf8' )
const cleanEnvContent = envContent.split( '\n' ).map( ( line ) => {
// If the line has no =, then return it as is
@ThatGuySam
ThatGuySam / export-one-transactions-as-csv.js
Last active June 9, 2023 16:45
Chrome Source Script to export ONE transactions to a CSV for the 2023 Tax Season
// 🚨 Running random code on your bank website
// is a popular way to commit fraud. 🚨
//
//
// Although I wrote this with the intent
// to help people get their transactions
// out of their One accounts as CSV
// this script is given with no warranty
// and you should ask a developer that
// you trust to double check it to make