Skip to content

Instantly share code, notes, and snippets.

chrisdiana / my-counter.js
Created May 24, 2021
Web Component Example
View my-counter.js
const template = document.createElement('template');
template.innerHTML = `
* {
font-size: 200%;
span {
width: 4rem;
display: inline-block;
chrisdiana /
Last active Oct 3, 2021
Getting mosh server running on macOS Catalina

Running into this error message when trying to run a mosh server on macOS Catalina? The steps below should solve the problem which is most likely either a $PATH and/or firewall issues.

command not found: mosh-server
Connection to X.X.X.X closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

1. Install Mosh

chrisdiana /
Last active Sep 13, 2021
Export AWS Cognito User Pool
# Export as Text Table
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output table > ~/users.txt
# Export as JSON
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output json > ~/users.json
# Export User Pool with more than 60 users (pagination)
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --pagination-token INCREDIBLYLONGSTRINGHERE --output json > ~/users-2.json
chrisdiana / gist:ac64daf20d405b33d7a6
Last active Sep 10, 2021
PHP Login without Database
View gist:ac64daf20d405b33d7a6
// ***************************************** //
// ********** DECLARE VARIABLES ********** //
// ***************************************** //
$username = 'username';
$password = 'password';
chrisdiana /
Last active Sep 7, 2021
Amazon Linux EC2 Starter
sudo yum update -y
sudo yum install -y tmux vim docker htop wget git w3m python3 htop curl
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo pip3 install virtualenv
virtualenv -p python3 venv
aws configure
sudo systemctl enable docker
curl -o- | bash
. ~/.nvm/
chrisdiana /
Created Mar 15, 2019
Large Scale Vue Application Structure

Large Scale Vue Application Structure

Application Structure LIFT Principle

  • Locating our code is easy
  • Identify code at a glance
  • Flat structure as long as we can
  • Try to stay DRY (Don’t Repeat Yourself) or T-DRY

"Folders-by-Feature" Structure

chrisdiana / index.html
Last active Aug 21, 2021
Simple Vue / Vuetify Template
View index.html
<!DOCTYPE html>
<link href=",300,400,500,700,900" rel="stylesheet">
<link href="" rel="stylesheet">
<link href="" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<div id="app">
chrisdiana /
Last active Jul 13, 2021
OP-Z Cheatsheet


  • Play: Press Play
  • Stop: Press Stop
  • Sequence: Hold Trig + key
  • Sequence v2: Hold Rec + keys
  • Live Record: Hold Rec + Play + key/Play
  • Stop Recording: Press Rec


  • Metronome Volume: Hold M + Red Dial
chrisdiana /
Last active Jul 8, 2021
Python Application Structures

One-Off Script

├── .gitignore
├── requirements.txt
chrisdiana / InstallChrome.ps1
Last active Jun 18, 2021
Install Chrome on Windows
View InstallChrome.ps1
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)