Skip to content

Instantly share code, notes, and snippets.

@mscalora
mscalora / Impressionistic-Realism.txt
Last active January 27, 2026 14:46
AI Prompt for Impressionistic Realism - Photo => Painting convesion
FROM: https://www.reddit.com/r/AiGeminiPhotoPrompts/comments/1pfud63/how_to_turn_your_photo_into_bold_thick_paint_on/
Original: (usually replaces background with spray of bright colors)
Generate an image from the uploaded photo. Keep your facial features and skin tone at 100 percent. Keep the look gender neutral. Show you as a painted figure with thick palette knife texture, visible strokes, fresh oil paint, and a heavy textured canvas surface. Place you in a chaotic colorful abstract background with uneven marks and strokes that match the same painted style. Use close camera framing so you fill most of the scene. Keep strong light from the front to show texture and color contrast.
Leave Background: (usually makes existing background look more abscrat with the new painting style)
Generate an image from the uploaded photo. Keep your facial features and skin tone at 100 percent. Keep the look gender neutral. Show you as a painted figure with thick palette knife texture, visible strokes, fresh oil paint, and
@mscalora
mscalora / my-ip.py
Created December 22, 2025 02:19
Example of uv shebang with inline dependency metadata
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "requests",
# ]
# ///
import requests
@mscalora
mscalora / micro_time.h
Last active September 15, 2025 02:17
A very small library of north american centric date/time utilities
#define ATLANTIC_TZ -5
#define EASTERN_TZ -5
#define CENTRAL_TZ -6
#define MOUNTAIN_TZ -7
#define PACIFIC_TZ -8
#define ALASKA_TZ -9
#define HAWAII_TZ -11
struct DateTime {
@mscalora
mscalora / micro_ntp.h
Created September 15, 2025 02:13
A very small NTP client
#include <vector>
#include <functional>
const char* poolNTPServerName = "pool.ntp.org";
const unsigned long seventyYears = 2208988800UL;
class MicroNTP {
public:
static const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message
@mscalora
mscalora / cmpdirs.py
Created February 18, 2018 22:07
Based on Andriy Makukha's script from https://askubuntu.com/questions/421712/comparing-the-contents-of-two-directories/996529#996529 with a third parameter of a skip/exclude regular expression
#!/usr/bin/env python3
import os, sys, re
skip = re.compile(sys.argv[3] if len(sys.argv) > 3 else '$.')
def compare_dirs(d1: "old directory name", d2: "new directory name"):
def print_local(a, msg):
print('DIR ' if a[2] else 'FILE', a[1], msg)
# ensure validity
@mscalora
mscalora / get.js
Last active September 9, 2025 16:54
Client-side js helper function for GETing
function get(url, data, successCallback, errorCallback, responseType) {
const urlObj = new URL(url);
const params = urlObj.searchParams;
Object.entries(data||{}).forEach(([key, value]) => params.set(key, value));
url = urlObj.toString();
fetch(url)
.then(response => {
if (!response.ok) { throw new Error(response.status); }
const contentType = response.headers.get('content-type');
const isJson = responseType === 'json' || (responseType === 'auto' && contentType && contentType.includes('application/json'));
@mscalora
mscalora / post.js
Created September 9, 2025 15:00
Client-side js helper function for POSTing
function post(url, data, successCallback, errorCallback, responseType) {
fetch(url, {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams(data),
})
.then(response => {
if (!response.ok) { throw new Error(response.status); }
const contentType = response.headers.get('content-type');
const isJson = responseType === 'json' || (responseType === 'auto' && contentType && contentType.includes('application/json'))
@mscalora
mscalora / README.md
Last active May 24, 2025 14:16
This set of scripts/files is used to link blink cameras to PrusaConnect.

This set of scripts/files is used to link blink cameras to PrusaConnect.

This is rough, you need a working knowledge of python, requirements.txt, venv to use.

The cron job has worked reliably for me for several years.

Generating the blink.creds file is an exercise left to the reader, study the blinkpy documentation.

@mscalora
mscalora / letsencrypt-update-lighttpd
Last active January 18, 2024 00:28
script to auto update letsencrypt certs for debian lighttpd installation (based on script by Danny Tuppeny)
#!/usr/bin/env bash
#
# Update letsencrypt on a lighttp installation
#
# if you installed letsencrypt in a non-standard location you
# can set the LEDIR env var before you run this script
#
# setup letsencrypt install directory
STDLEDIR=/opt/letsencrypt
@mscalora
mscalora / overrides.ini
Created November 24, 2023 16:53
Prusa Slicer Defaults Test INI
[print:*common*]
perimeters = 4
skirts = 0
first_layer_speed = 18
[print:*MK4*]
first_layer_speed = 19