| 更新: | 2021-06-23 |
|---|---|
| 作者: | @voluntas |
| バージョン: | 2021.11 |
| URL: | https://voluntas.github.io/ |
目的
| // 客户端实现 | |
| const net = require('net') | |
| const tls = require('tls') | |
| const localServer = new net.Server() | |
| localServer.on('connection', (socket) => { | |
| socket.pause() | |
| const context = { |
| { | |
| "name": "your-project", | |
| "version": "0.0.1", | |
| [...] | |
| "scripts": { | |
| "build": "react-scripts build", | |
| "postbuild": "./postbuild.sh", | |
| [...] | |
| }, | |
| } |
| function zipmerge(/* ...lists */) { | |
| var lists = Array.prototype.slice.call(arguments) | |
| // find longest list | |
| var nlists = lists.length, maxlen = 0, i | |
| for (i = 0; i < nlists; i++) { | |
| maxlen = Math.max(arguments[i].length, maxlen) | |
| } | |
| // populate result |
| var artboards = context.document.valueForKeyPath("pages.@unionOfArrays.artboards"), | |
| artboardLoop = artboards.objectEnumerator(), | |
| artboard; | |
| while (artboard = artboardLoop.nextObject()) { | |
| artboard.exportOptions().setLayerOptions(2); | |
| } |
| function findStringInTextLayers(textToFind,exactMatch,currentPage) { | |
| var predicate = NSPredicate.predicateWithFormat("className == %@","MSTextLayer"), | |
| textLayers = NSMutableArray.array(); | |
| if (currentPage == 1) { | |
| var page = context.document.currentPage(); | |
| textLayers.addObjectsFromArray(page.children().filteredArrayUsingPredicate(predicate)); | |
| } else { | |
| var pages = context.document.pages(), |
| 更新: | 2021-06-23 |
|---|---|
| 作者: | @voluntas |
| バージョン: | 2021.11 |
| URL: | https://voluntas.github.io/ |
目的
| const fs = require('fs') | |
| const Path = require('path') | |
| function mkdirs(path, p) { | |
| if (p === undefined) { | |
| p = path.length | |
| path = Path.resolve(path) | |
| } | |
| try { | |
| fs.mkdirSync(path) |
sfddiff [-merge outfile] [-ignorehints] [-ignorenames] [-ignoregpos] [-ignoregsub] [-ignorebitmaps]
[-exact] [-warn] [-version] [-help] fontfile1 fontfile2
Sfddiff compares (or merges) two font files (in any format fontforge can read) and checks for differences.
It will notice:
| <!DOCTYPE html> | |
| <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" lang="fr"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <!--[if mso]> | |
| <xml> | |
| <o:OfficeDocumentSettings> | |
| <o:AllowPNG/> | |
| <o:PixelsPerInch>96</o:PixelsPerInch> |
| // | |
| // Figma project stats | |
| // Pulls statistics like number of files, frames, versions etc for a project. | |
| // | |
| // Usage: | |
| // export FIGMA_API_ACCESS_TOKEN='your-token' | |
| // node figma-project-stats.js <project-id> | |
| // | |
| // You can generate tokens in your account settings or at | |
| // https://www.figma.com/developers/explorer#personal-access-token |