Skip to content

Instantly share code, notes, and snippets.

View opentechnologist's full-sized avatar
🏠
Working from home

Mario (BU) Flores Rey II opentechnologist

🏠
Working from home
View GitHub Profile
@opentechnologist
opentechnologist / SimpleSMTPMailer.php
Created February 4, 2026 07:17
basic smtp class in php for sending simple email.
<?php
/**
* SimpleSMTPMailer Class
* Author: Mario Flores Rey II <mr3y2@yahoo.com>
*
* Minimal, pure-PHP SMTP client for sending emails over SMTPS (implicit SSL on port 465).
* Compatible with PHP 5.6.40+. Used for testing purposes only. Avoid production use.
*
* Usage:
* $mailer = new SimpleSMTPMailer([
@opentechnologist
opentechnologist / testturnstile.php
Created February 4, 2026 07:13
a simple php script to determine if turnstile setup is working properly.
<?php
/**
* Simple Turnstile Setup Testing
* Author: Mario Flores Rey II <mr3y2@yahoo.com>
*
* Minimal, pure-PHP script for testing a Cloudflare Turnstile setup.
* Compatible with PHP 5.6.40+. Remembers verification for N minutes.
*
* Not for production use.
*/
@opentechnologist
opentechnologist / testrecaptcha.php
Created February 1, 2026 06:42
a simple php script to determine if recaptcha setup is working properly.
<?php
/**
* Simple reCAPTCHA Setup Testing
* Author: Mario Flores Rey II <mr3y2@yahoo.com>
*
* Minimal, pure-PHP script for testing a Google reCAPTCHA setup.
* Compatible with PHP 5.6.40+. Remembers verification for N minutes.
* Maximizes verification request that is currently at 10K usage cap.
*
* Limitation Notes:
@opentechnologist
opentechnologist / demo.py
Created November 21, 2025 15:07
a simple exponential back-off implementation in python
from time import sleep
import random
from exponential_backoff import ExponentialBackoff
def demo(iterations=1000):
backoff = ExponentialBackoff(initial=3, maximum=10) # sleeps between 3 to 10 seconds
def get_next_item():
@opentechnologist
opentechnologist / apicache.js
Created September 29, 2025 05:36
a simple axios request interceptor implementation to cache response data for a particular period of time to optimize multiple endpoint requests.
class ApiCache {
static CACHE_KEY_PREFIX = '__API_CACHE__';
constructor(axios) {
this.axios = axios.create();
this.axios.interceptors.request.use(this.requestInterceptor.bind(this));
}
// djb2 hash function
hash(str) {
@opentechnologist
opentechnologist / RsaFileHelper.cs
Created September 22, 2025 21:31
a simple implementation of file tamper detection in c# using rsa cryptographic functions.
using System.IO;
using System.Security.Cryptography;
namespace RsaFileCrypto
{
public class RsaFileHelper
{
// Signs a file using a private key (XML format), using a byte array
public void SignFile(string inputFile, string signatureFile, string privateKeyXml)
{
@opentechnologist
opentechnologist / main.cs
Created August 7, 2025 10:04
a tiny c# project that shows the use of the system timer class that periodically calls a class method after a specified amount of time.
using System;
using System.Timers;
namespace MainPackage
{
class MainClass
{
private static Timer timer;
static void Main(string[] args)
@opentechnologist
opentechnologist / Elapsed.cs
Created July 23, 2025 00:56
a small c# project with a custom class that keeps track of different elapsed times - useful for determining how long a particular piece of code is running.
using System;
using System.Collections.Generic;
namespace Elapsed
{
public class ElapsedTimeService
{
public class ElapsedTime
{
public DateTime? Last { get; set; }
@opentechnologist
opentechnologist / app.manifest
Created July 8, 2025 00:56
a c# project that uses a manifest file to gain elevated privelege access.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="main"
type="win32"
/>
<description>Elevated Privelege UAC Demo</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
@opentechnologist
opentechnologist / Logger.cs
Created July 6, 2025 07:07
a sample C# project that logs timestamped messages to a text file using a custom text logger class.
using System;
using System.IO;
namespace Logger
{
public class TextLoggerService
{
private readonly string filePath;
public TextLoggerService()