Skip to content

Instantly share code, notes, and snippets.

View dact221's full-sized avatar

Diego A. Casas dact221

View GitHub Profile
@dact221
dact221 / svg-to-pdf-latex.py
Last active May 25, 2024 14:37
Simple Python program that monitors changes in SVG files and export them as PDF+LaTeX
import os
import time
import subprocess
INKSCAPE = "C:/Program Files/Inkscape/bin/inkscape.exe"
while True:
for f in os.listdir():
root, ext = os.path.splitext(f)
if ext != ".svg":
write-host "󰌢 Windows 11 Home"
write-host "󰞷 PowerShell $($PSVersionTable.PSVersion)"
write-host
Import-Module -Name Terminal-Icons
oh-my-posh init pwsh --config ~/.mytheme.omp.json | Invoke-Expression
@dact221
dact221 / .mytheme.omp.json
Last active May 25, 2024 16:03
My Oh-My-Posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"console_title": false,
"final_space": true,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
isfrom2to9(n) = n != '0' && n != '1'
function clean(phone_number)
filtered = filter(isnumeric, phone_number)
n = length(filtered)
if n == 11
filtered[1] != '1' && return nothing
filtered = filtered[2:end]
n = 10
end
@dact221
dact221 / dambreak.py
Created April 25, 2020 23:41
Simple dam break model to test OpenSeesPy
# -- coding: utf-8 --
import os
import openseespy.opensees as ops
# ------------------------------
# Start of model generation
# -----------------------------
# remove existing model