Skip to content

Instantly share code, notes, and snippets.

View L422Y's full-sized avatar
🤓

Larry Williamson L422Y

🤓
View GitHub Profile
@L422Y
L422Y / osx_automount_nfs.md
Last active May 4, 2024 14:26
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@L422Y
L422Y / nuxt3-pm2-build-deploy-on-arm.yaml
Last active April 4, 2024 13:00
Github Actions Workflow to build and deploy Nuxt 3 SSR with PM2, as well as node-canvas, on ARM64, utilizing cache for `pnpm` and `apt` including the build for `node-canvas`
name: "Build and deploy Nuxt SSR with PM2"
on: [push]
jobs:
build:
name: "Build Nuxt Application"
runs-on: [self-hosted, ARM64] # you can also use buildjet.com
environment:
name: "Production"
steps:
- uses: actions/checkout@v3
@L422Y
L422Y / setup-ses-route53.sh
Created November 1, 2023 14:19
Setup Amazon SES and DKIM verification with Route53
#!/bin/bash
# example: ./setup-ses-route53.sh <hosted-zone-id> <domain>
# Check if the correct number of arguments are provided
if [[ "$#" -ne 2 ]]; then
echo "Usage: $0 <hosted-zone-id> <domain>"
exit 1
fi
@L422Y
L422Y / ResponsivePanes.ts
Created October 29, 2023 04:51
ResponsivePanes: Vue 3 Component which takes a "components" property for using different parent and child components based on viewport width
import type { Component, Ref } from "vue"
import { defineComponent, h, onBeforeUnmount, onMounted, ref } from "vue"
/**
* ResponsivePanes is a component that renders its children in a responsive manner.
*
* @example
* <ResponsivePanes :components="[
* { parent: BAccordion, child: BAccordionItem }, // Mobile/Small (default)
* { parent: BTabs, child: BTab, minWidth: 768 }, // Tablet/Medium
@L422Y
L422Y / !README.md
Last active June 1, 2023 17:08
Dynamic, Responsive font-sizes and spacing using em units and JavaScript

Dynamic responsive font-sizing is something I see missing on many “responsive” websites. Breakpoints are nice but I have better things to do with my time than defining infinite font-size adjustments. (so do you!)

To implement this, we’re going to take advantage of the em font sizing unit in CSS.

Click here to see what I'm talking about: codepen.io/lawrencealan/full/eJqlu

Text sizing using the em unit

A single em is equal to the current font-size of the closest parent which has a font-size set.

@L422Y
L422Y / install-pimox7-opi5.sh
Last active April 4, 2023 13:36
shell script to download and run the pimox7 installer for arm64
#!/bin/sh
# These steps are copied directly from the post here: https://www.reddit.com/r/Proxmox/comments/104z8pt/comment/jewwf7u/
sudo -s
curl https://raw.githubusercontent.com/pimox/pimox7/master/RPiOS64-IA-Install.sh > RPiOS64-IA-Install.sh
chmod +x RPiOS64-IA-Install.sh
./RPiOS64-IA-Install.sh
@L422Y
L422Y / LatestEvents.gql
Last active March 20, 2023 14:27
WPGraphQL Custom Resolver: The Events Calendar PRO
{
events(first: 10, where: {status: PUBLISH}) {
edges {
node {
uri
title
cost
costMax
costMin
content
@L422Y
L422Y / random-web3-provider.js
Last active January 4, 2022 17:17
random web3 provider - check if your provider is connected, pick another at random if not and keep trying
let setupProvider = async () => {
const endpoints = [
'https://bsc-dataseed1.defibit.io/',
'https://bsc-dataseed.binance.org/',
'https://bsc-dataseed1.ninicoin.io/',
'https://bsc-dataseed2.defibit.io/',
'https://bsc-dataseed3.defibit.io/',
'https://bsc-dataseed4.defibit.io/',
'https://bsc-dataseed2.ninicoin.io/',
'https://bsc-dataseed3.ninicoin.io/',
@L422Y
L422Y / generate_users.py
Created March 14, 2013 04:47
django utility script to generate random users, profiles, entries
#!/usr/bin/python
__author__ = 'lawrencealan+github@gmail.com'
"""
Generates random users, profiles and game entries for testing.
"""
@L422Y
L422Y / multisync.sh
Last active February 21, 2021 23:57
lftp script to mirror remote ftp site to local folder using multiple connections per file and parallel file downloads (for reference/cron jobs)
#!/bin/bash
do_multisync() {
remote_dir="private/files"
local_dir="/root/i_drive/files"
# remote host
host="ftp.myremotehost.com"
# username / password
user="larry"