Skip to content

Instantly share code, notes, and snippets.

View haschdl's full-sized avatar

Half Scheidl haschdl

View GitHub Profile
@haschdl
haschdl / RectanglePro-WebPagesLayout.applescript
Created September 12, 2023 20:55
Reload web pages to different windows and set their location using Rectangle Pro
-- List of URLs and layout keys
set urlLayoutList to {¬
{URL:"https://nok.se", layout:"left-half"}, ¬
{URL:"https://translate.google.com/?sl=en&tl=sv", layout:"top-right"}, ¬
{URL:"https://translate.google.com/?sl=sv&tl=en", layout:"bottom-right"} ¬
}
repeat with i from 1 to length of urlLayoutList
@haschdl
haschdl / swedish_resources.md
Last active January 25, 2023 10:33
A compilation of resources for learning Swedish on my own

Project: Swedish 2023

This is a compilation of tools I'll use while trying to learn Swedish - without going to formal classes. This is not a recommendation but more of a way to use what I had available from before.

Focus: READING

  1. Swedish dictionary for Kindle Since I already had a Kindle device.
@haschdl
haschdl / rename_pages.py
Created September 7, 2022 20:57
Updating Confluence pages with a three-like numbering (1, 1.1, etc)
from atlassian import Confluence
import configparser
import json
import re
from tabulate import tabulate
config = configparser.ConfigParser()
config.read('auth.cfg')
CONF_URL=config['Confluence']['URL']
kelvin_table = {
1000: (255, 56, 0),
1100: (255, 71, 0),
1200: (255, 83, 0),
1300: (255, 93, 0),
1400: (255, 101, 0),
1500: (255, 109, 0),
1600: (255, 115, 0),
1700: (255, 121, 0),
1800: (255, 126, 0),
@haschdl
haschdl / kelvin_to_rgb.py
Created January 4, 2021 11:39
A list of RGB codes that closely match a temperature in Kelvin. I think I used this to create some kind of spectrogram audio visualization
kelvin_table = {
1000: (255, 56, 0),
1100: (255, 71, 0),
1200: (255, 83, 0),
1300: (255, 93, 0),
1400: (255, 101, 0),
1500: (255, 109, 0),
1600: (255, 115, 0),
1700: (255, 121, 0),
1800: (255, 126, 0),
/***
* This script ungroups all items recursivele, and moves path items to 4 layers, using a round-robin approach.
*
* Context: spliting a SVG created for plotting with 4 different pen colors.
* In my workflow the SVGs are created with code using the Processing environment.
*
*
* Tested on: Illustrator CC 2020 only
* Reminder to self: ESTK is compatible with ECMA 3
*
@haschdl
haschdl / ppt_change_color.vba
Created March 20, 2020 10:19
Change PowerPoint colors
Sub ChangeTextColors()
Dim oSl As Slide
Dim oSh As Shape
Dim x As Long
Dim lOldColor As Long
Dim lNewColor As Long
' Set lOldcolor to the RGB value you're looking for
lOldColor = RGB(205, 32, 38)
@haschdl
haschdl / Palette.js
Created February 17, 2020 07:51
Adobe Colors to Java array
/* This script is a quick hack to extract the HEX colors
from color.adobe.com and save it to the clipboard as a java array
I created this to import the colors in Processing.
*/
let selector = '[class^=ColorModes__colorValue_';
let elements = Array.from(document.querySelectorAll(selector));
elements = elements.filter(el => el.innerText.startsWith("#")).map(el => el.innerText);
elements = elements.map(i => "0xFF" + i.replace("#",""));
[...new Set(elements)].toString();
import sys
import re
import os
from pathlib import Path
from shutil import copyfile
import argparse
import logging
logging.getLogger(__name__)
# example on how to save Processing sketch in Python mode
# copy and paste to your sketch
from datetime import datetime
def keyPressed():
if key == 'S' or key == 's':
saveSketch()
# example on how to save Processing sketch in Python mode