Skip to content

Instantly share code, notes, and snippets.

View Inventsable's full-sized avatar
🌎
Now I am become Life, the creator of worlds

Tom Scharstein Inventsable

🌎
Now I am become Life, the creator of worlds
View GitHub Profile
@creold
creold / copyColorsToClipboard.jsx
Last active June 1, 2023 09:46
Copy selected color values to a user's clipboard. Adobe Illustrator script
/*
copyColorsToClipboard.jsx by https://github.com/Inventsable
For revisions email: tom@inventsable.cc
Illustrator script to copy selected color values in the form [TYPE]=[VALUES] to a user's clipboard,
preferring SPOT color names over values
Discussion: https://community.adobe.com/t5/illustrator-discussions/copy-color-values-to-clipboard/m-p/13791617
Modification by Sergey Osokin, https://github.com/creold:
- Added path collection within groups
@Klustre
Klustre / README.md
Last active April 4, 2023 16:08
Generate a KBar toolbar

node-kbar

Generate a KBar toolbar with NodeJS

Note: This only creates script buttons with SVG icons and a single script file

Why?

Manually creating a toolbar for every product update is tedious. Save time and avoid release anxiety by automating it.

Usage

@creold
creold / sortLayers.jsx
Created September 9, 2021 04:51 — forked from Inventsable/sortLayers.jsx
Recursively sort all layers in Illustrator alphabetically
var deep = true, // Set to false if you don't want to recursively sort layers within layers too
isLowerFirst = true; // Set it to false if you want to place the layers with the first uppercase letter above
// Convert ILST collection into standard Array so we can use Array methods
function get(type, parent) {
if (arguments.length == 1 || !parent) parent = app.activeDocument;
var result = [];
if (!parent[type]) return result;
for (var i = 0; i < parent[type].length; i++) result.push(parent[type][i]);
return result;
@iconifyit
iconifyit / SVGWriterTest.jsx
Last active April 9, 2020 10:55
Experimental code sending JSX message to com.adobe.svgwriter (internal CEP extension). Not currently working.
/*-------------------------------------------------------------------------------------------------------------------------*/
/**
* Adds JSON library support for engines that do not include it natively.
*/
"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){
return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];
return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}
function str(t,e){var n,r,o,f,u,i=gap,p=e[t];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(t)),
"function"==typeof rep&&(p=rep.call(e,t,p)),typeof p){case"string":return quote(p);case"number":return isFinite(p)?String(p):"null";
case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(gap+=indent,u=[],"[object Array]"===Object.prototype.toString.apply(p)){
@iconifyit
iconifyit / SelectionExporter.js
Created January 20, 2020 04:10
JavaScript Extension class for exporting a selection in Illustrator as SVG.
/*
* Usage :
*
* new SelectionExporter(
* app.activeDocument.selection[0],
* '/tmp/somefolder/tempfile.ai',
* 'My File'
* );
*/
const { Worker, isMainThread, parentPort } = require('worker_threads');
if (isMainThread) {
// This code is executed in the main thread and not in the worker.
// Create the worker.
const worker = new Worker(__filename);
// Listen for messages from the worker and print them.
worker.on('message', (msg) => { console.log(msg); });
} else {
// This code is executed in the worker and not in the main thread.
@Sergeon
Sergeon / commit-msg
Last active December 4, 2019 01:54
Commit-msg git hook with node.js
#!/usr/bin/env node
/**
*
* This code will ensure that before every commit in your client repository, your branch name and commit message adheres to a certain contract.
* In this example, branch names must be like 'feature/AP-22-some-feature-name' or 'hotfix/AP-30-invitation-email-not-sending', and commit messages must start like some issue code, like AP-100 or AP-101.
*
* 'AP' just stands for Acme Platform and is an example. I made this example with Jira in mind, since Jira issue codes have this structure -as far as I know-, but is pretty easy to change it to any other issue id like #100 or $-AP-120, or whatever.
*
* In order for this to work, you should go to .git/hooks in any git client repository and create a commit-msg file (or modify the provided by default, commit-msg.sample) with
@eeropic
eeropic / Ae expressions and scripts.js
Last active June 12, 2024 10:23
After effects expressions and scripts collected from various authors and myself.
//dynamic parenting for 3d layers
//from Dan Ebberts on forums I think..
//Position
L=thisComp.layer("Object center");
L.toWorld(L.effect(name)("3D Point"));
//Scale
L =thisComp.layer("Object center");
[L.transform.scale[0]/100*value[0],L.transform.scale[1]/100*value[1],L.transform.scale[2]/100*value[2]];
@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active May 6, 2024 06:11
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@jmsdnns
jmsdnns / jd-export.jsx
Last active May 1, 2024 21:14
Illustrator script—Exports CMYK, RGB, and Hex values for all the color swatches in a document. CMYK to RGB conversion using Adobe’s default US Web Coated SWOP2 to sRGB.
/**
* jd-export.jsx
* -------------
* Illustrator script—Exports CMYK, RGB, and Hex values for all the color
* swatches in a document. CMYK to RGB conversion using Adobe’s default US
* Web Coated SWOP2 to sRGB.
*
*
* LICENSE
* -------