Skip to content

Instantly share code, notes, and snippets.

View cprima's full-sized avatar

Christian Prior-Mamulyan cprima

  • Germany
View GitHub Profile
@cprima
cprima / Generate-Solarized-Sprites.ps1
Last active April 6, 2025 12:39
Generate Solarized Color SVG Sprites for UI Styling
<#
.SYNOPSIS
Generates SVG sprite files for all 16 Solarized colors.
.DESCRIPTION
Creates rectangular bar and circular icon SVG files in various dimensions, suitable for use in documentation styling, UI mockups, or visual metadata indicators. Output includes:
- Bars: 720x16, 360x8, 8x8, 16x16
- Circles: 4x4, 8x8, 16x16
@cprima
cprima / README.md
Last active April 2, 2025 20:48
Chat Export to JSON: LLM Markdown Extractor

🧾 extract_llm_conversation.py

Extract structured Markdown-formatted conversations from exported LLM chat HTML files (e.g., ChatGPT). Outputs a clean JSON file with user/assistant roles, turns, and content.


📦 Features

  • Parses exported chat .html files
  • Detects roles via visually hidden headings (You said:, ChatGPT said:)
@cprima
cprima / README.md
Last active April 2, 2025 18:26
Extract Graphical Activities from UiPath XAML Workflows

UiPath XAML Graphical Activity Extractor

Author: Christian Prior-Mamulyan
License: CC-BY
Email: [email protected]

📌 Purpose

This script parses a UiPath .xaml workflow file and extracts only those elements that are visually represented in UiPath Studio (i.e., shown in the workflow designer panel). It uses structural rules and a metadata blacklist for accuracy.

@cprima
cprima / README.md
Created January 2, 2025 11:50
Sort CSV Places Along a GPX Route to Generate a Sorted Roadbook(Python Script)

Sort CSV Places Along a GPX Route to Generate a Sorted Roadbook (Python Script)

This Python script sorts unsorted geographical data (from a CSV file) based on its proximity to a predefined GPX track. It generates a sorted "roadbook" by ordering places in the sequence they are encountered along the route. Ideal for cyclists, hikers, and geospatial analysts working with Overpass API results or similar unsorted data sources.


Features

  • Align Places to GPX Track: Matches CSV places (e.g., towns, landmarks) to the nearest points on a GPX track.
@cprima
cprima / README.md
Created December 30, 2024 21:56
Calculate Sunrise, Sunset, and Civil Twilight with Python

Solar Event Calculator: Civil Twilight, Sunrise, Sunset, and Meridian

Description

This Python script calculates civil twilight, sunrise, sunset, and solar noon (meridian) times for a list of geographic locations provided in a CSV file. The output includes local timezone information and UTC offsets for each location, ensuring precise timing based on coordinates.

Features

  • Calculates civil dawn, sunrise, meridian (solar noon), sunset, and civil dusk.
  • Adjusts times to the local timezone of each location.
@cprima
cprima / README.md
Created December 30, 2024 19:27
Buffer GPX Tracks in QGIS and Extract Place Data with Overpass API

README: Using QGIS and Overpass API for GPX Buffer and Data Extraction


Step 1: Create a Buffer from a GPX File in QGIS

  1. Load the GPX File:
    • Open QGIS and go to Layer > Add Layer > Add Vector Layer.
    • Browse and select your GPX file.
    • Import the Tracks or Waypoints layer as required.
@cprima
cprima / README.md
Created December 29, 2024 17:47
Advanced tour planning with brouter considering its cost-per-km factor

Effort-Adjusted Bicycle Tour Planner

Overview

The Effort-Adjusted Bicycle Tour Planner is a Python-based tool designed to enhance the planning of multi-week bicycle tours using data from BRouter-Web. The tool segments long routes into manageable daily chunks based on user-defined effort or time limits, making multi-day planning practical and adaptable.

Key Features

  1. Effort-Based Segmentation
    • Plan your daily cycling routes based on personalized effort levels (e.g., distance adjusted for elevation and terrain).
    • Supports a reduced first-day effort for late starts or adjustments.
@cprima
cprima / InvokeCode.vb
Created December 6, 2024 21:57
embed test
Try
' Initialize output variables
out_Status = "Success"
out_ErrorMessage = String.Empty
out_LogMessages = New List(Of Tuple(Of String, UiPath.Core.Activities.LogLevel))()
' Log start of file deletion process
Dim startMessage As String = "Starting file deletion process."
Console.WriteLine(startMessage)
out_LogMessages.Add(New Tuple(Of String, UiPath.Core.Activities.LogLevel)(startMessage, UiPath.Core.Activities.LogLevel.Info))
@cprima
cprima / Create-Snapshots.ps1
Last active January 25, 2025 21:27
Script for Creating, Archiving and Zipping Git Snapshots by Tag, Branch, or Commit
<#
.SYNOPSIS
Creates snapshots of a Git repository at specified tags, branches, or commits.
.DESCRIPTION
This script generates snapshots of a Git repository based on user-defined labels, branches, tags, or specific commits.
The snapshots are saved as separate folders and then compressed into a timestamped ZIP file. The script can
optionally force delete existing snapshot folders without user confirmation.
NOTE: This script must be placed and run from the root of the Git repository for the `git archive` commands to work correctly.
@cprima
cprima / README.md
Last active March 19, 2025 00:40
Bypass X-Frame-Options: PHP Proxy for iframe Embedding

PHP Proxy Script for Iframe Embedding

Description

This PHP script is a server-side proxy designed to bypass restrictions that prevent embedding external websites within iframes. Many websites use security headers (e.g., X-Frame-Options or Content-Security-Policy) to block their content from being displayed in iframes, leading to errors like "Content refused to connect." when trying to embed them directly. This proxy script retrieves the content server-side, modifies it, and delivers it to the iframe, effectively circumventing these restrictions.

Use Case

This script is particularly useful for integrating external web pages into Reveal.js presentations. Reveal.js allows the use of iframes to display content during slideshows. However, embedding some web pages directly often fails due to security restrictions. By using this proxy script, users can include external content seamlessly in their presentations without encountering connection errors.

Why is This Needed