Skip to content

Instantly share code, notes, and snippets.

@jpwain
jpwain / resize.scpt
Created April 23, 2020 21:31
Resize a Mac window to exact dimensions
(*
This Apple script will resize any program window to an exact size and the window is then moved to the center of your screen. Specify the program name, height and width below and run the script.
Written by Amit Agarwal on December 10, 2013
*)
set theApp to "Slack"
set appHeight to 1080
@jpwain
jpwain / sizecheck.sh
Created May 4, 2017 17:54
asset size comparison
#!/bin/bash
ARGC=$#
# if no directory specified, use current
if [ $ARGC -eq 0 ]
then
BASEDIR=${PWD}
else
BASEDIR=${1}
@jpwain
jpwain / mov2gif-ffmpeg-gifsicle.txt
Last active November 22, 2016 20:55
GIF from QuickTime screen capture using ffmpeg and gifsicle
ffmpeg -i input.mov -s 640x480 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=5 > output.gif
@jpwain
jpwain / android-display-to-mac.md
Last active October 23, 2022 12:23
Pipe Android device display to local Mac display using ffmpeg

On the Android device, enable Developer options, and enable USB debugging.

On the Mac:

$ brew install ffmpeg --with-ffplay

$ adb shell screenrecord --output-format=h264 - | ffplay - -x 720 -y 1280

Replace the 720 and 1280 with other values to scale the output as desired.