A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
-- Show system hidden files | |
tell application "Finder" to quit | |
tell application "System Events" to do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true" | |
tell application "Finder" to launch | |
-- copy file to clipboard | |
tell app "Finder" to set the clipboard to (POSIX file "/Users/zhangyongkang/Desktop/Markdown.md") | |
### Points and display type | |
PPI is points per inch below, not pixels per inch. Not all models are listed, just the first model with a new display size. Diamond, RGB Stripe and Pentile RGB refer to the subpixel patterns. | |
iPhone 1 = 320×480 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 4 = 320×480 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 5 = 320×568 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 6 = 375×667 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 6 Plus = 414×736 at 153.5PPI sRGB IPS LCD RGB Stripe | |
iPhone 7 = 375×667 at 163PPI P3 IPS LCD RGB Stripe |
let documentWindow = NSApplication.sharedApplication().mainWindow() | |
let mySheetWindow = NSWindow.alloc().initWithContentRect_styleMask_backing_defer( | |
NSMakeRect(0, 0, 300, 50), | |
(NSWindowStyleMaskTitled | NSWindowStyleMaskDocModalWindow), | |
NSBackingStoreBuffered, | |
true | |
) | |
let progressView = NSProgressIndicator | |
.alloc() |
const {toArray} = require('util'); | |
// returns a timestamp | |
const timeStamp = () => { | |
const now = new Date(); | |
return `${'0'.concat(now.getHours()).slice(-2)}:${'0'.concat(now.getMinutes()).slice(-2)}:${'0'.concat(now.getSeconds()).slice(-2)}.${now.getMilliseconds().toString().concat('000').slice(0,3)}`; | |
} | |
// Assumes an existing text layer called 'debug_output' on the current page that's NOT in a group or artboard | |
// parameters: the Sketch page object, the thing (or an array of things) to log, whether or not to clear previous logs |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
rebase
vs merge
).rebase
vs merge
)reset
vs checkout
vs revert
)git rev-parse
)pull
vs fetch
)stash
vs branch
)reset
vs checkout
vs revert
)This is a collection of lists that I have created for use in various UI design projects. They are intended to be added as custom types in text section of the Craft plugin from InVision. Although these were made as part of my Sketch design workflow, they are simple text lists, so I am sure they can be used for other purposes as well. Contributions welcome!
A Plugin for Sketch that compresses your bitmap assets, to keep filesize to a minimum.
Please note that the compression is lossless, so no pixels will be harmed by running this Plugin : )
// define the scope for the search/replace | |
var artboard = context.document.currentPage().currentArtboard(); | |
var layers = artboard.children(); | |
// this method will list all font names that are used in the scope | |
function listFontNames() { |
This is what Craft does:
function loadFramework(pluginRoot) {
if (NSClassFromString('PanelsManager') == null) {
var mocha = [Mocha sharedRuntime];
return [mocha loadFrameworkWithName:'Panels' inDirectory:pluginRoot];
} else {
return true;
}