This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
def spinner(msg="working..."): | |
i = 0 | |
ticks = ["-", "\\", "|", "/"] | |
try: | |
while True: | |
tick = ticks[i % len(ticks)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import itemgetter | |
from typing import Any, Self | |
from textual._two_way_dict import TwoWayDict | |
from textual.app import App, ComposeResult | |
from textual.events import Click | |
from textual.widgets import DataTable | |
from textual.widgets.data_table import CellType, ColumnKey, RowKey | |
ROWS = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Clean-up junky files by reducing any group, compound path, and clipping mask contents to just paths. | |
* | |
* This works no matter how nested the container object are and works for better for weird | |
* edge cases than trying to remove each element from each container via the API. | |
*/ | |
var doc = app.activeDocument; // Get active document | |
var sel = doc.selection; // Get selected items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////// | |
// Advanced Table Search Filtererrr // | |
////////////////////////////////////// | |
// Setup: | |
// 1. Page **must** include table with the id "search-table" (only one) | |
// 2. Page **must** include text input with id "search-input" (only one) | |
// 3. Table **may** include data-attribute "data-search-ignore-cols" | |
// that will ignore any columns listed in the data attribute. | |
// Columns to be ignored must be listed by index number (0-based) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Please note this is a hacky example in response to a question | |
// on the Adobe forums at the link below. | |
// https://community.adobe.com/t5/illustrator-discussions/using-artboards-as-an-archive-that-is-searchable/td-p/13504883 | |
var aiVersion = parseFloat(app.version); | |
var locale = $.locale; | |
var os = $.os; | |
var sysOS = /mac/i.test(os) ? "mac" : "win"; | |
var windowsFlickerFix = sysOS === "win" && aiVersion < 26.4 ? true : false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create inset rectangles and ellipses and place into compound path | |
var doc = app.activeDocument; | |
var al = doc.activeLayer; | |
// type of path | |
// var type = "rectangle" | |
var pathType = "ellipse"; | |
// amount of inset paths (max: 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def score_round(elf_idx, me_idx): | |
if elf_idx == me_idx: # draw | |
return me_idx + 1 + 3 | |
elif me_idx % 3 != (elf_idx + 2) % 3: # win | |
return me_idx + 1 + 6 | |
else: | |
return me_idx + 1 # lose | |
data = open("day2.in").read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
data = open("day25.in").read().strip().split("\n") | |
tracker = defaultdict(str) | |
rows = len(data) | |
cols = len(data[0]) | |
for r, line in enumerate(data): | |
for c, d in enumerate(line): | |
if d != ".": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ai Command Palette | |
Copyright 2022 Josh Duncan | |
https://joshbduncan.com | |
This script is distributed under the MIT License. | |
See the LICENSE file for details. | |
*/ | |
// TODO: add the ability to edit custom commands |
NewerOlder