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 / 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 / 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

Prusa Slicer Default Print Settings

Description

I hate skirts, I find them to be a big waste of time, a small waste of filament with little or no value. The purge line in the preamble is plenty for my printer. I got tired of turning them off manually every time I used a built-in print setting. By editing this file you can change the built-ins although you have to do this again every time a new "settings update" is applied. In the future I might automate the process with a file watcher mechanism that will run every night or something. I also like to print with at least 3 parimeters and I slow down the first layer by 10% from the usual 20.

Edit

@mscalora
mscalora / server.py
Created November 23, 2022 14:34
Python 3 HTTP Server Example
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib import parse
import json
def run_server(port):
class Server(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)