Skip to content

Instantly share code, notes, and snippets.

View orbitturner's full-sized avatar
💭
🚀 Keep Moving Forward 💻

Orbit Turner orbitturner

💭
🚀 Keep Moving Forward 💻
View GitHub Profile
@orbitturner
orbitturner / Orbit-PG-Daily-Backupper.py
Last active March 20, 2024 19:13
The script automates PostgreSQL database backups. It creates backups using the pg_dump tool and logs backup activities. It allows customization of backup parameters and database connection details. The script iterates over specified databases, creates backup folders, executes backup commands, and logs backup activities. Overall, it provides a st…
import os
import subprocess
from datetime import datetime
from loguru import logger
from termcolor import colored
from art import text2art
def print_colored_ascii_art(text):
# Generate and print colored ASCII art
colored_ascii_art = colored(text2art(text, "small"), 'cyan')
@orbitturner
orbitturner / OpenWindowsExplorerWithSearchMs.ts
Created March 16, 2024 13:36
Open Windows File Explorer From Web App
/**
* Opens the Windows File Explorer search window (`search-ms`) with the specified query and location.
* @param {string} query - The search string to use in the `search-ms` window.
* @param {string} location - The directory location you want to explore.
* @returns {void}
*
* @see {@link https://docs.microsoft.com/en-us/windows/win32/shell/search-ms}
*/
export function openSearchMsWindow(query: string, location: string): void {
// Encode URL components
@orbitturner
orbitturner / GetOrdoredWeeksInGivenPeriod.js
Last active August 4, 2022 16:44
Get Weeks in given Period with the days name. A week Meaning From Monday To Sunday. If the month is not complete, the last or first week will be filled with the fist/last days of the month.
/**
* Get Weeks in given Period.
* A week Meaning From Monday To Sunday.
* If the month is not complete, the last or first week will be filled with the fist/last days of the month.
*
* @param startDate - First Day in Range
* @param endDate - Last Day in Range
* @returns - Array of Weeks
*/
function GetWeeksInGivenPeriod(startDate, endDate) {
@orbitturner
orbitturner / Install NVM.md
Created May 12, 2022 18:28
Install NVM on Fedora

Install NVM on Fedora

1. Install node and NPM:

sudo dnf install -y nodejs npm

2. Install NVM via NPM:

@orbitturner
orbitturner / PGSQL-BACKUPPER.bat
Created January 18, 2022 10:38
This is a batch script to backup the database using PostgreSQL backup utility "pg_dump". You can add this script to the Windows Task Scheduler and define your custom backup routine.
@REM Author: Orbit Turner
@echo off
chcp 65001
echo "=======================================================";
echo " ____ ____ ____ _ ____ _ ___ _ ____ ";
echo " | _ \ / ___| | __ ) / \ / ___| |/ / | | | _ \ ";
echo " | |_) | | _ _____| _ \ / _ \| | | ' /| | | | |_) |";
echo " | __/| |_| |_____| |_) / ___ \ |___| . \| |_| | __/ ";