View UngroupUnclipUncompound.jsx
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 |
View GoToArtboardExample.jsx
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; |
View InsetShapesCompoundPath.jsx
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) |
View day2.py
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() |
View AiCommandPalette-NO-ACTIONS.jsx
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 |
View spinner_object.py
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 | |
spinners = { | |
"angles": ["◢", "◣", "◤", "◥"], | |
"circle": ["◜", "◠", "◝", "◞", "◡", "◟"], | |
"dots": ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], | |
"ticks": ["-", "\\", "|", "/"], | |
} |
View spinner_ctxmanager.py
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 | |
from contextlib import contextmanager | |
def spinner_indicator(msg): | |
ticks = ["-", "\\", "|", "/"] | |
i = 0 | |
while True: | |
tick = ticks[i % len(ticks)] |
View spinner_simple.py
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)] |
View javascript-table-search-filter.js
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) |
NewerOlder