Skip to content

Instantly share code, notes, and snippets.

@adgedenkers
adgedenkers / CheckPipUpdate.ps1
Created October 31, 2023 12:27
Check to see if pip needs to be updated
'''
Name: CheckPipUpdate.ps1
Description: Checks if pip needs to be updated, and updates it if necessary.
Author: Adge Denkers / github.com/adgedenkers/
Created: 10/31/2023
Updated: 10/31/2023
(C) 2023 denkers.co
'''
function Get-InstalledPipVersion {
@adgedenkers
adgedenkers / shave_and_haircut__horn.ino
Created October 22, 2023 15:41
Car Horn and Relay play Shave and a Haircut
/*
Name: shave_and_haircut__horn.ino
Description: Plays the tune "Shave and a Haircut" on a car horn when a dashboard button is pressed.
Author: Adge Denkers / github.com/adgedenkers/
Created: October 22, 2023
Updated: October 22, 2023
(C) 2023 denkers.co
*/
const int buttonPin = 2; // Pin connected to the dashboard button
@adgedenkers
adgedenkers / turn_on_led.ino
Created October 22, 2023 15:40
Hello World of Gemma Programming - Turn on an LED
/*
Name: LED_Controller.ino
Description: Lights an LED connected to pin D1 when Gemma v3 is powered on, and keeps the LED on.
Author: Adge Denkers / github.com/adgedenkers/
Created: October 22, 2023
Updated: October 22, 2023
(C) 2023 denkers.co
*/
void setup() {
@adgedenkers
adgedenkers / shave_and_haircut__led.ino
Created October 22, 2023 15:39
Flashes an LED in the pattern of the tune "Shave and a Haircut" when Gemma v3 is powered on.
/*
Name: Shave_and_a_Haircut_LED.ino
Description: Flashes an LED in the pattern of the tune "Shave and a Haircut" when Gemma v3 is powered on.
Author: Adge Denkers / github.com/adgedenkers/
Created: October 22, 2023
Updated: October 22, 2023
(C) 2023 denkers.co
*/
void setup() {
@adgedenkers
adgedenkers / make__dim_date.py
Last active October 28, 2023 19:08
Create an empty SQLite Database, and add a fairly robust date dimension to it
'''
File: make__dim_date.py
Project: fz_tools
Created Date: 2023-10-13
Author: Adge Denkers
Email: @adgedenkers
-----
Last Modified: 2023-10-28
Modified By: Adge Denkers
Email: @adgedenkers
@adgedenkers
adgedenkers / gitignore_for_python
Last active October 25, 2023 17:06
.gitignore File for Most Python Applications
# adge's special stuff
setup*.py
*setup.py
secrets.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
@adgedenkers
adgedenkers / get_latest_python_for_windows.ps1
Created September 18, 2023 17:22
Find and Download the Latest Python Script Using PowerShell
<#
Project: powershell_dev
File: get_latest_python_for_windows.ps1
Author: Adge Denkers
License: MIT License
#>
# Define the root and downloads URLs
$rootUrl = "https://python.org"
$downloadsUrl = "$rootUrl/downloads/windows/"
@adgedenkers
adgedenkers / get_latest_python_for_win.py
Created September 18, 2023 16:35
Get the latest Python Installer for Windows
import requests
from bs4 import BeautifulSoup
import webbrowser
def find_and_open_stable_release_link():
"""Find the first stable release link on the Python downloads page for Windows
and open it in the default web browser.
"""
# Define the root and downloads URLs
@adgedenkers
adgedenkers / password_security_test.py
Created August 2, 2023 20:58
Test how secure your password is against a brute force attack
import math
def password_security(password):
# The number of possible characters in the password.
# This is roughly the number of printable ASCII characters.
N = 95
# The length of the password.
L = len(password)
import pyodbc
import pandas as pd
import numpy as np
from datetime import timedelta, date
from holidays import UnitedStates
# Function to generate date range
def daterange(start_date, end_date):
for n in range(int((end_date - start_date).days) + 1):
yield start_date + timedelta(n)