Skip to content

Instantly share code, notes, and snippets.

View colorwebdesigner's full-sized avatar

Ivan Pro colorwebdesigner

View GitHub Profile
@colorwebdesigner
colorwebdesigner / pcinfo.sh
Last active February 24, 2022 22:52
Tested on GNU Linux Debian system. Collect general inormation about PC hardware, generate nice report and print to cli or file.
#!/bin/bash
# pcinfo.sh
# ---
# Collect general inormation about PC hardware,
# generate nice report and print to cli or file
# --------------------------------------------------------
# author : ip@spiderlab.ru
# license : GNU
# date : 17.02.2022
# src : https://gist.github.com/colorwebdesigner/b8cd5225741066c502c2f9435f7ae47a
@colorwebdesigner
colorwebdesigner / DEV_LIFE.sh
Last active May 30, 2025 20:13
DEV_LIFE — A Bash Koan. A minimalist pseudo-code parable about every developer’s journey from framework dependence to enlightenment.
function DEV_LIFE() {
while true; do
FRAMEWORK
if [ DEPENDENCIES -gt UNDERSTANDING ]; then
continue
elif [ SOUL -eq FREEDOM ]; then
LINUX && BASH
break
fi
done
@colorwebdesigner
colorwebdesigner / pageViewCounter.php
Last active June 8, 2025 07:29
MODx Plugin for Unique page views counter with cookie-based tracking
<?php
/**
* pageViewCounter - Unique page views counter with cookie-based tracking
* by Colorwebdesigner
* based on: https://itchief.ru/modx/page-hit-counter
*
* EVENT: OnLoadWebDocument
*
* CONFIGURATION:
* 1. Create a TV (Template Variable) with name "views_page" (type: Number)
@colorwebdesigner
colorwebdesigner / SecureDownload.php
Created June 8, 2025 19:36
SecureDownload - Protected File Download with Counter for MODX Revolution
<?php
/**
* SecureDownload - Protected File Download with Counter for MODX Revolution
*
* Features:
* 1. Generates secure time-limited download links
* 2. Tracks download counts in a Template Variable
* 3. Automatically resolves file paths from Media Source
* 4. Prevents direct access to files
* 5. Detailed logging for debugging