Skip to content

Instantly share code, notes, and snippets.

@elmimmo
elmimmo / render.zsh
Last active February 8, 2024 18:47
Render multiple Blender documents and their scenes from the command line.
#!/bin/zsh
# Render multiple Blender documents and their scenes from the command line.
# Only scenes named with the suffix "*" will be rendered.
#
# Author: Jorge Hernández Valiñani
# Check dependencies
: "${blender:="/Applications/Blender.app/Contents/MacOS/Blender"}"
@elmimmo
elmimmo / export_snippets.py
Last active November 5, 2023 09:04
Export snippets stored in Dash by kapeli.com to text files
import sqlite3
import os
# Connect to the SQLite database
db_path = "dash snippets.dash" # Path to the SQLite database file
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Query to retrieve records from the "snippets" table
cursor.execute("SELECT sid, title, body, syntax FROM snippets")
@elmimmo
elmimmo / Spot inks to process.jsx
Last active November 23, 2022 15:51
Adobe InDesign scripts to convert spot ink swatches to process or set them to print as process
// DESCRIPTION: Sets existing spot color inks to print as process.
// Does not affect spot inks added after the script is ran, so rerun if necessary.
// Jorge Hernández Valiñani
#target indesign
(function () {
var myInks = app.activeDocument.inks;
for (var i = 0; i < myInks.length; i++) {
if (myInks[i].isProcessInk == false) {
@elmimmo
elmimmo / DumpCD.tool
Last active August 4, 2022 19:11
Dump contents of optical media upon inserting, then eject and repeat. (requires macOS)
#!/usr/bin/env bash
# Dump contents of optical media upon inserting, then eject and repeat.
#
# Requires macOS.
#
# If ran without the appropriate env variables, it will ask for:
# * destination
# * order no. to be recorded for the first media being copied. The orden no.
# of each copy which will be logged into a CSV file created in _destination_
@elmimmo
elmimmo / plist2xml.xslt
Created June 1, 2012 10:47
XSLT: from plist to intermediate XML format
<?xml version="1.0" encoding="utf-8"?>
<!-- Stylesheet for converting between plist and an intermediate format -->
<!-- Copyright 2006 Theo Hultberg, all rights reserved -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"
indent="yes"
@elmimmo
elmimmo / selectAllTumblrPosts.js
Last active January 2, 2020 14:10
Select all posts in Tumblr Mass Post Editor
var my_array = document.querySelectorAll('[id^=post_]');
var i;
for (i = 0; i < Math.min(my_array.length, 100); i += 1) {
my_array[i].click();
}
@elmimmo
elmimmo / Reindex.tool
Last active November 29, 2019 12:27
Batch-add an empty file and Finder comment to a list of directories as a way of matching them to a catalog id
#!/bin/bash
# Batch-add an empty file and Finder comment to a list of directories
# as a way of matching them to a catalog id.
#
# Takes a 2-column semicolon-separated CSV file. First column is a
# directory; second column is a catalog index or id. Creates an empty
# txt file whose filename is the catalog index in the 2nd column inside
# the directory in the 1st column. Also writes the catalog index in the
# 2nd column as a Finder comment (overwriting any existing one) of the
@elmimmo
elmimmo / local.shared.savethemblobs.plist
Last active January 23, 2018 18:43
Script to schedule automated batch-downloading of all SHSH blobs from Apple that it's currently signing for all iOS devices you own. You are expected to have ran TinyUmbrella at east once. Requires https://github.com/Neal/savethemblobs.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.shared.savethemblobs</string>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>19</integer>
@elmimmo
elmimmo / center-images.xhtml
Last active October 27, 2017 11:09
Center images in ebooks
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<title>Centering images in ebooks</title>
<!-- <link rel="stylesheet" type="text/css" href="style.css"/> -->
<style type="text/css">
.center-image {
@elmimmo
elmimmo / poem.html
Created October 3, 2011 21:29
Semantic HTML for poems + CSS styles for indented wrapping lines for small screens
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Styling a poem</title>
<style type="text/css">
/* Left-aligned text in a centered block (mangles text in Adobe Digital Editions 1.7, so search an alternative if you need to support it) */
.poem {
display: table;
margin-right: auto;