Skip to content

Instantly share code, notes, and snippets.

View leeovery's full-sized avatar
🎯
Focusing

Lee Overy leeovery

🎯
Focusing
View GitHub Profile
@leeovery
leeovery / magic-methods.js
Created April 25, 2024 13:58 — forked from loilo/magic-methods.js
PHP Magic Methods in JavaScript
function magicMethods (clazz) {
// A toggle switch for the __isset method
// Needed to control "prop in instance" inside of getters
let issetEnabled = true
const classHandler = Object.create(null)
// Trap for class instantiation
classHandler.construct = (target, args, receiver) => {
// Wrapped class instance
@leeovery
leeovery / sample.png
Created March 11, 2022 09:27 — forked from jirutka/sample.png
Nested numbered list with correct indentation in CSS. Live example at http://jsfiddle.net/a84enL8k/.
sample.png
@leeovery
leeovery / aws_create_users_ubuntu.sh
Created March 10, 2022 13:51 — forked from vasansr/aws_create_users_ubuntu.sh
AWS User Data Script to create users when launching an Ubuntu server EC2 instance
#!/bin/bash
#
# Initial script to create users when launching an Ubuntu server EC2 instance
#
declare -A USERKEY
#
# Create one entry for every user who needs access. Be sure to change the key to their
@leeovery
leeovery / gist:1c591d82021de756d1dfed3b9cc708df
Created August 13, 2021 19:14 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
@leeovery
leeovery / mysql-docker.sh
Created September 14, 2020 14:53 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@leeovery
leeovery / px-rem-tw.csv
Created May 20, 2019 18:57 — forked from trevorgreenleaf/px-rem-tw.csv
PX to REM'S to TAILWIND CSS
PX REM TW
4 0.25 1
8 0.5 2
16 1 4
32 2 8
48 3 12
64 4 16
80 5 20
96 6 24
112 7 28
@leeovery
leeovery / osx_automount_nfs.md
Created February 20, 2019 19:23 — forked from L422Y/osx_automount_nfs.md
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

@leeovery
leeovery / nginx.conf
Last active April 17, 2024 19:47
Modified Nginx configuration file for servers provisioned by Laravel Forge
# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user forge;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
@leeovery
leeovery / states_hash.json
Created March 30, 2016 12:22 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@leeovery
leeovery / US State List
Created March 30, 2016 12:22 — forked from tvpmb/US State List
JSON Array with List of US States with 2-char ISO codes.
[
{"name":"Alabama","alpha-2":"AL"},
{"name":"Alaska","alpha-2":"AK"},
{"name":"Arizona","alpha-2":"AZ"},
{"name":"Arkansas","alpha-2":"AR"},
{"name":"California","alpha-2":"CA"},
{"name":"Colorado","alpha-2":"CO"},
{"name":"Connecticut","alpha-2":"CT"},
{"name":"Delaware","alpha-2":"DE"},
{"name":"District of Columbia","alpha-2":"DC"},