Skip to content

Instantly share code, notes, and snippets.

View MatthewCallis's full-sized avatar
🍖
Hungry Goriya

Matthew Callis MatthewCallis

🍖
Hungry Goriya
View GitHub Profile
@MatthewCallis
MatthewCallis / index.html
Created January 13, 2023 19:12
Animated Form Labels
<div className="flex gap-3 justify-between">
<div className="animated-label w-full">
<fieldset>
<input
defaultValue={user?.FirstName}
id="first-name"
name="first-name"
type="text"
autoComplete="given-name"
className={`${inputStyles} ${hasError['first-name'] && 'border-red-500'}`}
@MatthewCallis
MatthewCallis / zones.coffee
Created December 15, 2015 20:17
ISO Language Codes, ISO Country Codes, Time Zones
values =
locale_country_code: [
{ title: "Andorra", value: "AD" },
{ title: "United Arab Emirates", value: "AE" },
{ title: "Afghanistan", value: "AF" },
{ title: "Antigua and Barbuda", value: "AG" },
{ title: "Anguilla", value: "AI" },
{ title: "Albania", value: "AL" },
{ title: "Armenia", value: "AM" },
{ title: "Angola", value: "AO" },
@MatthewCallis
MatthewCallis / !INTERESTIN SPAM.md
Last active December 4, 2022 19:18
Interesting SPAM: I collect interesting SPAM emails.

SPAM Emails

I collect interesting SPAM emails.

Possible Ideas / Why would you do this?

  • Train your own spam detection
  • Generate hilarious SPAM-esque content
  • Create an English-2-Spam converter
  • Create a terrible chat bot to respond to and occupy the time of SPAMers
@MatthewCallis
MatthewCallis / ffmpeg-video-generation.sh
Created April 30, 2022 01:31
Use FFMPEG to generate video for audio
# Game of Life
ffmpeg -i audio.wav \
-vsync vfr -filter_complex "life=size=1920x1554:mold=10:rate=60:random_fill_ratio=0.1:death_color=#ff32ff:life_color=#33feff[left]; \
[0:a]showspectrum=mode=separate:slide=scroll:color=rainbow:scale=cbrt:size=1920x1554[right]; \
[0:a]showwaves=size=3840x606:mode=p2p:rate=30:colors=0xff32ff|0x33feff[bottom]; \
[left][right]hstack[top]; \
[top][bottom]vstack[out]" -map "[out]" -map 0:a -c:v libx264 -profile:v high -bf 2 -g 30 -crf 18 -pix_fmt yuv420p -c:a aac -b:a 384k -r 48000 -shortest -movflags +faststart -threads 0
# Cellauto
ffmpeg -i audio.wav \
@MatthewCallis
MatthewCallis / cassette-tape-recorder.md
Last active March 5, 2022 06:50
Helpful Information & Links for Cassette Tape Recorders

Tascam Portastudio 414

Some notes for working on and with the Tascam 414 Portastudio 4 Track Recorder deck.

The gap between Erase and Write is 0:00:245 in length at normal speed, 0:00:301 at slow speed.

Generic 5 Second Cassette Loop

This is a generic clear tape loop from WarbleLoopLab. The tape has a particular constant warble, to the point a clear sine tone cannot be read out enough to get an exact key difference. The BPM difference is also impacted by the extreme warble, where it will skip ahead or completely stop on occasion.

@MatthewCallis
MatthewCallis / input-filter.js
Created February 11, 2022 06:00
HTML Form Input Filtering
/**
* Check keyed input for semver values with onKeyPress.
*
* @param {React.KeyboardEvent} e Event
*/
export const versionOnly = (e) => {
const code = e.which || e.keyCode || 0;
// Allow: Backspace, Delete, Tab, Escape, Enter, Return
if ([46, 8, 9, 27, 13, 110].includes(code)) { return; }
// Allow: Decimals
@MatthewCallis
MatthewCallis / heart-snow.js
Created February 11, 2022 00:33
Konami Code Heart Snow Background
// Create the CSS
const styleText = document.createTextNode(`@keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
100% { background-position: 500px 1000px, 400px 400px, 300px 300px; }
}
body.heart-snow {
background-image:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAMAAABOo35HAAAAclBMVEX////fJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjffJjepqKlSAAAAJnRSTlMAKlhkSAoLUTtaTAQ8VkYUFWFgKxAdZjEWSVcGCCA5XENEAwUfMq8Mq3MAAAGmSURBVHgB7MGDFcBAFATAjW3b/beYEv49BzsDIiIiei1NN0wLpMJ2XM3zIaMgjOIEaQYZhXkRemWVQ0Z1A7RJZ4JkZl8NGOsJJBtmfVm3ZYcKOs7Vu+727tAKgBAGoiD9V41cH/PNTAUI4L3sJccDAAC5lFxKLiWXkkshl5JLyaUAQE2sJlYTq4nVxKiJ1cRq4gEAAAAAAAAArXNa57TOaZ3TOqd1Dq1zWucAAADJoeRQcig5lBwiOZQcSg4BAJAvyZfkS/Il5EvyJfmSfAkAABEVIioRlYhKRCWiElEhogIlAUoCJYGS4HBdKAl2XSgJLteFkuB+XSgJJAgSBNeFBAEAAAAAAAAA9Pxa9Zr4dCo3TXyHHRKsOmjiC3bIVt038SX7Olh10MQX7Outum/ii/Z1sOqgiS/Y11u15lTsEAAAAAAAAAAAAAAAAAAAAPDPLbyz653dnQfv7J
@MatthewCallis
MatthewCallis / toc.js
Created January 5, 2022 00:51
Table of Contents Generator
const tableOfContents = (options) => {
if (!options.element) {
return;
}
const container = options.container ? document.querySelector(options.container) : document.body;
const selectors = options.selectors ? options.selectors.split(',').map((s) => s.trim()) : ['h2', 'h3'];
const tocItems = [];
// Building dict
@MatthewCallis
MatthewCallis / docker-compose.yml
Created December 22, 2021 01:28
WordPress Docker
version: "3"
services:
# MySQL Database Image
mysql_database:
platform: linux/x86_64 # Required for Apple M1 chip
image: mysql
restart: unless-stopped
env_file: .env
environment:
@MatthewCallis
MatthewCallis / README.md
Created November 5, 2021 01:22
Simple Local WordPress
  1. Install Docker
  2. Create the docker-compose.yml in the empty directory we want to run the blog from
  3. Run docker-compose up -d from the directory we saved the docker-compose.yml
  4. Wait for everything to install and start
  5. Ensure any additional configuration you have in your production WordPress is in your wp-config.php file, but not the database credentials
  6. Replace the installed WordPress wp-content with your own
  7. Ensure your WordPress database is synced with production, phpMyAdmin is installed on http://localhost:8080
  8. You should now have a working local copy of your blog at http://localhost:8000

Instructions modified from Containerizing WordPress with Docker-Compose