Skip to content

Instantly share code, notes, and snippets.

View Klustre's full-sized avatar

Remco Janssen Klustre

View GitHub Profile
@Klustre
Klustre / encode-image.js
Last active June 8, 2019 08:02
Encode an image for use in ScriptUI
// Courtesy of @joonaspaakko
const picker = document.querySelector('input')
picker.oninput = function() {
const file = picker.files[0]
getBinary( file, function( binary ) {
const string =
`var dialog= new Window ("dialog");
var image = "${binary}";
@Klustre
Klustre / get-random-rgb.js
Created June 8, 2019 07:59
Generate Random RGB Value
/*
* Create a random RGB value.
* (c) 2009 Paul Irish, CCO License - http://creativecommons.org/publicdomain/zero/1.0/
* https://www.paulirish.com/2009/random-hex-color-code-snippets/
* @return {String} A random six-digit RGB hexcode
*/
const getRandomRGB = function () {
return '#' + Math.floor(Math.random() * 16777215).toString(16)
}
@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