Skip to content

Instantly share code, notes, and snippets.

View JavaScriptDude's full-sized avatar

Timothy C. Quinn JavaScriptDude

  • Ontario, Canada
View GitHub Profile
@JavaScriptDude
JavaScriptDude / debian_on_freenas.md
Last active February 5, 2024 23:55
Installing Debian on Freenas / BHYVE

Freenas -> Virutal Machines -> Add

Operating System

  • Guest OS: Linux
  • Name:
  • clock: (def)
  • Boot: (def)
  • shut. timeout: (def)
  • Start on Boot
@JavaScriptDude
JavaScriptDude / vb_collection_iterators.vb
Last active November 5, 2023 03:13
Iterators for Visual Basic Collection Class
' BEGIN VB Collection Hacks
' @copywright Timothy C. Quinn
' @license MIT
' Inspiration: https://stackoverflow.com/a/19497757/286807
' VB Collections don't have a public way to get the keys or have any iterators
' Below is a list of hacks that should be high performance and thread safe
' I doubt that the backend API of Visual Basic for Collections will change as its a really bad data structure to use
' However, this may possibly break in future versions of VB
' I tested up to VB 11
@JavaScriptDude
JavaScriptDude / SMTP_Python_3_7_plus.py
Last active October 25, 2023 19:47
SMTP Email in Python 3.7+
import smtplib
import os
import json
from email.message import EmailMessage
from validate_email import validate_email
class Mailer():
@JavaScriptDude
JavaScriptDude / asyncio_main_example_3_11.py
Last active September 26, 2023 22:57
Asyncio Example for Python 3.11+
# GIT Home: https://gist.github.com/JavaScriptDude/f673980de8e27a39cbffff55dd0c63b2
import sys
import traceback
import asyncio
_verbose = ("--verbose" in sys.argv)
opts = None
# Main - For all your business logic
# Note: do not call sys.exit() directly from here, instead use raise ExitProgram(msg=<msg>, code=<code>)
@JavaScriptDude
JavaScriptDude / Linux With ZFS Root on Mint
Last active February 14, 2024 20:13
Linux Mint 21.1 ZFS Root Installation Notes
When installing Linux Mint, you can install with ZFS Root by following standard instructions.
However, there is an issue with almost all Linux distributions default ZFS install script where the
allocated spaces for the partitions are a bit too small for real world ZFS Use.
These instructions show how to alter the ZFS setup script to have a more appropriate partition spacing.
Boot into the Linux Mint OS USB stick, and:
```
sudo su
cd /usr/share/ubiquity/
@JavaScriptDude
JavaScriptDude / README.md
Last active March 24, 2023 21:18
Installing KDE Plasma on Linux Min 21x

Installing KDE Plasma on Linux Min 21x

First update system

sudo apt update
sudo apt -y full-upgrade

Reboot

@JavaScriptDude
JavaScriptDude / README.md
Last active November 6, 2023 05:22
VMWare Workstation 16 Launcher

VMWare Workstation for Linux v16 has issues related to memory fragmentation. This will cause the CPU to choke with 100% after a time. The scripts provided will allow you to fix this at launch of vmware on Linux.

Instructions:

  1. Put vmware-workstation.sh to a good location on your computer like ~/bin or similar
  2. Make vmware-workstation.sh executable
  3. Edit vmware-workstation.desktop to have correct paths based on your setup
  4. Open shell, cd to directory with .desktop file and run:
desktop-file-install --dir=$HOME/.local/share/applications ./vmware-workstation.desktop
@JavaScriptDude
JavaScriptDude / multi_test.py
Last active May 2, 2022 04:05
Python3 - Multi-Column Sorting of List of Dicts
import inspect, time
from random import randint
from functools import cmp_to_key
def main():
perf_test()
# test_Comparator()
# test_student_comp()
students = [
@JavaScriptDude
JavaScriptDude / jquery_dialog_focus_test.html
Last active February 1, 2022 02:24
jQuery UI Dialog - Button Focus Tests
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Dialog - Focus Test</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.2/underscore-min.js" integrity="sha512-anTuWy6G+usqNI0z/BduDtGWMZLGieuJffU89wUU7zwY/JhmDzFrfIZFA3PY7CEX4qxmn3QXRoXysk6NBh5muQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
@JavaScriptDude
JavaScriptDude / asyncio_main_example.py
Last active September 26, 2023 22:58
Python3 Asyncio Main Template
# GIT Home: https://gist.github.com/JavaScriptDude/f3c837fdabaf0e0a72e39ff319c7a3f0
# NOTE: This version works with Python 3.7.9.
# For Python 3.11, see https://gist.github.com/JavaScriptDude/f673980de8e27a39cbffff55dd0c63b2
import sys
import traceback
import asyncio
_verbose = ("--verbose" in sys.argv)
opts = None