Skip to content

Instantly share code, notes, and snippets.

@narthur
narthur / findLargestFile.sh
Created January 12, 2016 19:10
Find largest file recursively
sudo find /path/to/search/ -size +15M -printf "%s - %p\n" | sort -n | tail
@narthur
narthur / stopwatch.sh
Created January 12, 2016 19:08
Use Terminal as a stop watch
# To start stopwatch:
time cat
# To stop stopwatch:
ctrl+c
@narthur
narthur / sendItToMany.sh
Last active March 24, 2022 08:16
Send email attachment to multiple recipients using Mutt
a="[email protected], [email protected]"
mutt -s "subject" -a file.pdf -- $a
@narthur
narthur / removeDoubleTabs.jsx
Created June 11, 2015 15:26
InDesign script for replacing double tabs with single tabs
//Based on http://wwwimages.adobe.com/content/dam/Adobe/en/products/indesign/pdfs/InDesignCS5_ScriptingGuide_JS.pdf
var myDocument = app.activeDocument;
//Clear the find/change text preferences.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeTextOptions.caseSensitive = false;
app.findChangeTextOptions.includeFootnotes = false;
app.findChangeTextOptions.includeHiddenLayers = false;
app.findChangeTextOptions.includeLockedLayersForFind = false;
@narthur
narthur / TablesToText.jsx
Created June 11, 2015 15:24
InDesign script for converting tables to text
// Based on https://forums.adobe.com/thread/578555
var myDoc=app.activeDocument;
tableList = myDoc.textFrames.everyItem().tables.everyItem();
tableList.convertToText("\t","\r");
@narthur
narthur / adjustTableWidths.jsx
Last active May 22, 2024 09:26
InDesign JSX User Script to Adjust Table Widths Relative to Frame Width
// Inspiration:
// https://forums.adobe.com/message/2524327
// http://www.indiscripts.com/post/2009/10/work-around-the-width-height-gap
var myDoc = app.activeDocument;
function getWidth(/*PageItem*/obj, /*bool*/visible)
// return the [width,height] of <obj>
// according to its (geometric|visible)Bounds
{