Skip to content

Instantly share code, notes, and snippets.

@lg3bass
lg3bass / MACOS_sips_example.txt
Created September 10, 2014 17:31
MACOS>UNIX>sips
ICD-ImageResourceCD-SIPS
// get the height and width of every file in a directory (jpegs in this instance)
sips -g pixelHeight *.jpg sips -g pixelWidth *.jpg
//this will append the results to the end of a doc on the desktop.
sips -g pixelHeight *.jpg sips -g pixelWidth *.jpg >> ~Desktop/sips.txt
///BOB (dumbass!!, use this) - 12/10/07
@lg3bass
lg3bass / XSLT_examples.txt
Created September 10, 2014 17:38
XSLT>EXAMPLES
XSLT_CODE_EXAMPLES
====================================
//STYLE SHEET DECLARATION
<?xml-stylesheet type="text/xsl" href="XSL_STYLESHEETS/warningsAndRedirects_xls.xsl" alternate="no"?>
<!--THIS selects the nodes in order-->
@lg3bass
lg3bass / WWW_CSS_css-conditionals.txt
Created September 10, 2014 17:41
WWW>CSS>css conditionals
CSS Conditionals
-- to be used in the html <style> tags
<p>
<!--[if IE]>
According to the conditional comment this is Internet Explorer<br />
<![endif]-->
<!--[if IE 5]>
According to the conditional comment this is Internet Explorer 5<br />
<![endif]-->
@lg3bass
lg3bass / gist:76415855f8cc42bbe781
Created September 22, 2014 20:57
MACOS>UNIX>FFMPEG>get duration in seconds
USRLSML-2HLDV7L:350 uwhitbo$ ffprobe -i hughes_a.m4v -show_format 2>&1 | sed -n 's/duration=//p'
48.158178
brew update
brew doctor
brew upgrade cmake
@lg3bass
lg3bass / MACOS_UNIX_CP
Last active June 23, 2017 19:19
MACOS>UNIX>cp,mv,mkdir
//copy directory into another directory
cp -R CSV/ WPS_SITES/ab_middleton_law_mysearchlab_9/CSV/
//mkdir
//--the -p flag will create the intermediate directories.
mkdir -p LM/STINKBUT/TEST
//show the size of the home directory
@lg3bass
lg3bass / concatenate with ffmpeg
Last active August 29, 2015 14:25
MACOS>UNIX>FFMPEG>>Concatenate 2 videos together
//BOIL IT ALL DOWN TO 2 LOOPS
//|==++--++==||==++--++==||==++--++==||==++--++==||==++--++==||==++--++==||==++--++==||==++--++==||==++--++==|
//Loop through all the files and pad them
for FILENM in *; do ffmpeg -i $FILENM -filter:v 'pad=max(iw\,ih*(16/9))+mod(max(iw\,ih*(16/9))\,2):ow/(16/9)+mod(ow/(16/9)\,2):(ow-iw)/2:(oh-ih)/2' -aspect 16:9 -s hd720 -acodec copy -vcodec libx264 -preset slow -crf 18 ${FILENM/.mp4/}_pad.mp4; done;
//loop through all the files and add the posterframe. NOTE: posterTitle.mp4 must be one directory level up from the files you are working on.
for FILENM in *; do ffmpeg -i ../posterTitle.mp4 -i $FILENM -filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -vcodec h264 -pix_fmt yuv420p -an ${FILENM/.mp4/}_titled.mp4; done;
///////////////////////////////////
@lg3bass
lg3bass / gist:93b9a24ce678bc1acf54
Last active December 23, 2020 18:05
MACOS>UNIX>GIT>Create Repository From Existing
///NEW (2020-12-23)
1. Create a new repo on github. Make sure to not create a readme, licence, or git ignore. New repo MUST BE EMPTY!!!!
2. If you added NOTHING you will see the "Quick Setup" screen.
3. In your local repo (the folder you want to create the project from) run these commands in order:
LG3-MBP:ADSR lg3$ git init
LG3-MBP:ADSR lg3$ git add .
LG3-MBP:ADSR lg3$ git commit -m "enter a comment. What are you committing"
LG3-MBP:ADSR lg3$ git branch -M main
-- REF: https://docs.github.com/en/free-pro-team@latest/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
@lg3bass
lg3bass / gist:d89bc2a4720900a94487
Last active August 29, 2015 14:27
MACOS>UNIX>FFMPEG>Get Video Dimensions
//SOURCE:
//http://stackoverflow.com/questions/7362130/getting-video-dimension-from-ffmpeg-i
ffmpeg -i 1_1_misconception1_adaptivepathway_redo3.mp4 2>&1 | perl -lane 'print $1 if /(\d+x\d+) \[/'
that outputs : 768x432
//prints out the directory
for FILENM in *; do ffmpeg -i $FILENM 2>&1 | perl -lane 'print "\n",$1 if /(\d+x\d+) \[/'; printf $FILENM; done;
@lg3bass
lg3bass / gist:6863150f1cc45824ca77
Last active August 17, 2018 14:06
What version of stuff do I have?
# Check for Python
python --version
# Check for node.js on Linux
nodejs --version
# Check for node.js on Windows
node --version
//source: http://kripken.github.io/emscripten-site/docs/building_from_source/toolchain_what_is_needed.html#toolchain-test-which-dependencies-are-installed