Skip to content

Instantly share code, notes, and snippets.

@neozhaoliang
neozhaoliang / taichi_circle_packing.py
Last active October 6, 2023 08:01
Given an input image, convert it to a circle packing pattern
import cv2
import cairocffi as cairo
import numpy as np
import taichi as ti
ti.init(arch=ti.cpu)
scale = 5
@vielhuber
vielhuber / export.jsx
Created March 14, 2022 00:24
illustrator bulk export #js
var sourceDir = 'C:/Users/xxx/Downloads/in/',
destDir = 'C:/Users/xxx/Downloads/out/',
tmpFile = 'C:/Users/xxx/Downloads/tmp.svg',
logFile = 'C:/Users/xxx/Downloads/log.txt',
actionName = 'Export',
actionGroup = 'SVG',
override = false;
try {
alert('Let\'s go!');
/**
* @file trim strokes
* https://community.adobe.com/t5/illustrator-discussions/creating-a-sliced-path-dashed-dotted-path/m-p/12736845
* @version 0.1.0
* @author sttk3.com
* @copyright © 2022 sttk3.com
*/
//@target 'illustrator'
//@targetengine 'com.sttk3.trimStroke'
@jcupitt
jcupitt / litecor.py
Created August 4, 2020 14:33
light correction example with pyvips
#!/usr/bin/python3
import sys
import os
import pyvips
if len(sys.argv) < 3:
print(f"usage: {sys.argv[0]} grey-card-image image1 image2 ...")
print(f" light-correct a set of images with a grey card")
print(f" corrected images writtem to lc_image1, lc_image2, etc.")
@iconifyit
iconifyit / SVGExportAction.jsx
Last active December 10, 2023 00:59
Creates an Adobe Illustrator action to export to SVG on-the-fly.
/*
* This script creates an Adobe Illustrator action, on-the-fly, to export to SVG. The main thing to
* understand is that the `name` values in the action code are hexadecimal-encoded strings. The number
* that immediately preceeds the encoded name are the length of the hex string divided by 2.
*
* Usage:
*
* Change the `basePath` variable to match your file system. This can be set to any folder you like.
*
* Credits:
/**
* I am Lazy
* Too much Lazy! :D
* Good day!
*
* ==========================================
* Modified from Default SaveAsPdf
*
*/
@ciwik
ciwik / save_all_layers_as_files.jsx
Created May 21, 2019 14:20
Photoshop script used to save all drawing layers as separate files
#target photoshop
try
{
var doc = app.activeDocument;
var docName = doc.name.split('.')[0];
}
catch (e)
{
alert('Error');
@lyshie
lyshie / scratch_3_text.css
Last active March 15, 2023 10:59
放大 Scratch 3 字型 (Enlarge font size in Scratch 3)
/*
1. Install Stylus (https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne)
2. URL: Regular expression (https://scratch.mit.edu/projects/.*editor.*)
*/
/*
* {
font-family: "微軟正黑體" !important;
}
*/
; Accessible Info Viewer by jethrow
; https://autohotkey.com/board/topic/77888-accessible-info-viewer-alpha-release-2012-09-20/
; Modified by tmplinshi - https://gist.github.com/tmplinshi/0fcb8655c1402a3662ac048d0d974915/
#NoEnv
#SingleInstance, force
SetBatchLines, -1
{
WM_ACTIVATE := 0x06
@markwoon
markwoon / IllustratorDetector.java
Created July 16, 2018 23:52
Utility class to check if a file is an Illustrator file based on XMP metadata.
import java.io.BufferedInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* This utility class checks if a file is an Illustrator file.