Skip to content

Instantly share code, notes, and snippets.

View iconifyit's full-sized avatar
🏠
Working from home

Scott Lewis iconifyit

🏠
Working from home
View GitHub Profile
@iconifyit
iconifyit / fn-resize-artboards.js
Created November 28, 2022 19:24
Function that takes width and height as arguments and resizes all Artboards in an Illustrator document with those dimensions.
function doResizeArtboards(width, height) {
if (app.documents.length === 0) {
alert("There are no open documents.");
return;
}
var theDoc = app.activeDocument;
try {
for (i = 0; i < theDoc.artboards.length; i++) {
/**
@iconifyit
iconifyit / ExportOptionsSVG.js
Created December 20, 2019 04:58
Adobe Ilustrator JSX export as SVG with all ExportOptionsSVG object properties
function getExportOptionsSVG() {
var exportOptions = new ExportOptionsSVG();
/**
* A range of artboards to save, if saveMultipleArtboards is true. A comma-delimited list of artboard names., or the empty string to save all artboards. Default: empty String.
* {string}
*
* NOTE: Set to an empty string to export all. Be sure `saveMultipleArtboards` is set to true to use this.
*/
@iconifyit
iconifyit / product-repository.tsx
Created December 21, 2022 15:02
Medusa ProductRepository override
import { ProductRepository as MedusaProductRepository } from "@medusajs/medusa/dist/repositories/product";
import { Repository as MedusaRepository, Utils } from "medusa-extender";
import { EntityRepository, In } from "typeorm";
import { Product } from "./product.entity";
@MedusaRepository({ override: MedusaProductRepository })
@EntityRepository(Product)
export default class ProductRepository extends Utils.repositoryMixin<Product, MedusaProductRepository>(MedusaProductRepository) {
public async bulkAddToSet(
productIds: string[],
@iconifyit
iconifyit / git-tag-and-release.sh
Last active December 15, 2022 19:02
Interactive bash script to push a new tag and release version. Automatically increments major, minor, or patch version based on the latest tag (assumes you are using {major}.{minor}.{patch} format)
#!/usr/bin/env bash
############################################################
# Help #
############################################################
Help()
{
# Display Help
echo "Increment the latest tag and create a new tag & release."
echo
@iconifyit
iconifyit / two-variable-swap.js
Created December 5, 2022 20:31
Swap two variables set to integers without using a third variable
// Swap two variables, set to integers,
// without using a third variable.
// Any language you want, but no Assembly.
// Register swaps are cheating for
// this riddle.
let x = 3
let y = 5
console.log(x, y)
@iconifyit
iconifyit / resize-artboards-dropdown.js
Created November 28, 2022 20:27
Example Illustrator script to create a pop-up with dropdown list to change artboards to pre-selected sizes.
var docRef = app.activeDocument;
var dialog = new Window("dialog");
dialog.text = "Escolha Cilindro";
dialog.preferredSize.width = 400;
dialog.orientation = "column";
dialog.alignChildren = ["left", "top"];
dialog.spacing = 10;
dialog.margins = 16;
@iconifyit
iconifyit / delete_all_imessage_conversations.applescript
Created November 3, 2022 20:40 — forked from lexrus/delete_all_imessage_conversations.applescript
Delete all iMessage conversations. Compatible with macOS Monterey. Please check Reduce motion before launch this apple script.
# System Preferences -> Accessibility -> Display -> Reduce motion
tell application "Messages" to activate
tell application "Messages"
set chatCount to (count of chats)
end tell
tell application "System Events"
tell process "Messages"
@iconifyit
iconifyit / icon-contact-sheet.js
Last active October 11, 2022 07:11
Adobe Illustrator JSX plugin to create a contact sheet from a folder or vector icons.
/**
* Name that script.
*/
#script "Contact Sheet";
#target Illustrator
var originalInteractionLevel = userInteractionLevel;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
@iconifyit
iconifyit / authorize-plugin.sh
Created August 12, 2022 13:49
Authorize un-signed Adobe Illustrator plugin
# Update the path to Illustrator to match your system.
# This command is Mac OS only.
sudo xattr -r -d com.apple.quarantine /Applications/Adobe\ Illustrator\ 2022/Plug-ins/PlacedItemInfo.aip
@iconifyit
iconifyit / download-from-s3.sh
Created January 18, 2022 15:50
Script to download files from AWS S3 to a specified location.
#!/usr/bin/env bash
# Replace the text PATH_TO_YOUR_DROPBOX_FOLDER with the path to your Dropbox folder (e.g. /home/user/Dropbox)
DROPBOX_FOLDER="PATH_TO_YOUR_DROPBOX_FOLDER"
# DO NOT CHANGE ANYTHING BELOW THIS LINE
# ======================================
PDF_MERGE_WORK_FOLDER="$HOME/pdfmerge"