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
// Zeptobars has been producing fantastic photos of microelectronics | |
// for several years, see https://zeptobars.com I recently received | |
// a Nixplay digital picture frame, and wanted to upload the photos to | |
// the frame. | |
// | |
// The Nixplay picture frame has an image file size limit of 20MB. Some of | |
// the "HD" images from Zeptobars are larger than this, so this script finds | |
// all the photos in the collection over the limit and downsamples them | |
// to 2K resolution (more than enough for the Nixplay frame). |
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
# | |
# Many Amazon packages were lost when they started robbing the mail | |
# in LA. See https://twitter.com/johnschreiber/status/1481770722271760384 | |
# | |
# So, I wanted to check to see if stuff we'd sent back to Amazon actually | |
# arrived for a refund. Amazon typically sends two emails, one for | |
# initiating the return, and another for the actual refund. | |
# | |
# This plows through all the Amazon email, and collects the return/refund | |
# messages by order number, and produces a report, so you can quickly check |
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
<div style="overflow: auto;"> | |
<textarea id="data" rows="6" cols="80"> | |
[[[0,132.47098],[0,0],[585.1935,0],[586.91061,7.60481],[1.7171,140.0758],[0,132.47098]],[[585.1935,0],[674.50749,0],[675.50749,390.129],[667.90362,391.85029],[577.58963,1.72129],[585.1935,0]],[[676.50749,390.129],[674.50749,523.59999],[88.31399,525.59999],[86.53721,518.00889],[674.73071,382.5379],[676.50749,390.129]],[[88.31399,526.59999],[0,523.59999],[0,132.47098],[7.59518,130.71176],[95.90917,524.84077],[88.31399,526.59999]]] | |
</textarea> | |
</div> | |
<div id="content" style="overflow: auto;"> | |
<canvas id="drawing"> | |
</canvas> | |
</div> | |
<button id="reload"> |
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
# | |
# Pop open KB windows for MS updates. | |
# Go to the Windows Update panel. Then select all / Copy the text from | |
# the "Select Updates" pane. Paste it into a "Updates.txt" file. | |
# Then run this. It'll make a web page where all the update titles | |
# link to the web page with the actual description of the udpdate. | |
# | |
import os, webbrowser, re |
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
// | |
// Copy the vector mask from a shape to another layer. | |
// This takes layer names, modify as indicated below to take | |
// layer ID's instead. | |
// The shape is not deleted or modified. | |
function createMaskFromShape(srcShapeName, layerToClip) | |
{ | |
srcLayerRef = {"_ref":"layer","_name":srcShapeName}; // Replace "_name" with "_id" | |
dstLayerRef = {"_ref":"layer","_name":layerToClip}; // to use layer ID's instead. |
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
// Take a shape specified by clipShapeID, and use it to | |
// create a vectorMask for layer clippedLayerID. | |
// Shape layer is deleted. | |
function createMaskFromShape(clipShapeID, clippedLayerID) | |
{ | |
var clipShapeDesc = {"null":{"_ref":[{"_ref":"layer","_id":clipShapeID}]}}; | |
var clippedLayerDesc = {"null":{"_ref":[{"_ref":"layer","_id":clippedLayerID}]}}; | |
var vecMaskRef = {"_ref":"path","_enum":"path","_value":"vectorMask"}; |
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
// | |
// Sample code to retrieve the bounds of the layer's vector mask, and | |
// also get the unclipped bounds of the mask by temporarily disabling the | |
// vector mask. | |
// | |
// Get attribute from the active layer. | |
// Records the requested result in "state". | |
function promiseLayerGet(resultKey, state) | |
{ |
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
// | |
// Sample code to enable/disable Generator from DesignSpace JavaScript | |
// J. Peterson aug-'15 | |
// | |
// Reference to the generator keys | |
function appRef(key) | |
{ // either generatorStatus or pluginPicker | |
return {"_ref":[{"_ref":"property","_property":key}, | |
{"_ref":"application","_enum":"ordinal", |
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
// | |
// Code sample for creating a rectangular vector mask | |
// around the target paint layer. J. Peterson | |
// | |
function getLayerBounds() | |
{ | |
var p = new Promise(function(resolve, reject) | |
{ | |
_spaces.ps.descriptor.get({_ref:[{"_ref":"property","_property":"bounds"}, |
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
// | |
// Code sample for creating a rectangular vector mask | |
// around the target paint layer. J. Peterson | |
// | |
function getLayerBounds() | |
{ | |
var p = new Promise(function(resolve, reject) | |
{ | |
_spaces.ps.descriptor.get({_ref:[{"_ref":"property","_property":"bounds"}, |
NewerOlder