Skip to content

Instantly share code, notes, and snippets.

@lg3bass
lg3bass / jitter-jxs-notest.txt
Created December 5, 2020 16:07
jitter .jxs notes
//bind parmams cannot have "1" at the start of the var name.
//good: <param name="boxSize" type="float" default="0.4" />
//bad : <param name="1boxSize" type="float" default="0.4" />
@lg3bass
lg3bass / gist:429fea9288c06471131d4a058cea1393
Created August 27, 2020 21:02
get directory size | archive files and folders on a mac
//how-to-create-a-split-zipped-archive-from-mac-os-x-terminal
//source:
//https://www.addictivetips.com/mac-os/how-to-create-a-split-zipped-archive-from-mac-os-x-terminal/
//zip -r -s MaximumSize ArchiveName.zip FolderName/
zip -r -s 1g usheproduction-pearsoned-com usheproduction.pearsoned.com/
//Added Bonus: Get directory size and sort
@lg3bass
lg3bass / gist:127befd3ca8e2d4ed33020cc435d34ec
Last active August 13, 2020 15:27
FFMPEG - convert (MAX)AVRECORDR > Instagram
//one line combo magic. all the .mov p422 files in a directory
for FILENM in *; do ffmpeg -i $FILENM -c:v libx264 -c:a aac -vf format=yuv420p -crf 1 -movflags +faststart ${FILENM%.*}.mp4; done;
//To convert the .h264 (.mov) output, keeping the same codec,bitrate, etc.
//DIRECT OUT OF AVRECORDR (60fps,h.264)
//with faststart
ffmpeg -i 20200611-480x-h264.mov -c copy -movflags +faststart output2.mp4
//no faststart
@lg3bass
lg3bass / gist:9faadde4f75f26f621f5bed9718ea367
Created January 28, 2020 18:32
Using CURL + GREP to get a link out of a webpage
Unix command:
curl -s 'http://media.pearsoncmg.com/ph/hss/hss_manza_sociologyproject_1/applyingvideos/applying01.html' | grep -o 'script src="[^"]*"'
Result:
script src="http://mediaplayer.pearsoncmg.com/_ph_ssa3_cc_img_set.autoplay.false___set.width.768___set.height.432___embed.mytarget/ph/streaming/ssa/mysoclab/social_imagination/01_applying.m4v"
@lg3bass
lg3bass / gist:ad65309e79e8d9a730f9acef345856c7
Last active April 16, 2020 14:07
FFMPEG - Convert all videos in a directory (Examples)
//Convert all videos in a directory FLV > M4V (don't care bout quality)
for FILENM in *; do ffmpeg -y -i $FILENM ${FILENM%.*}.m4v; done;
//Converts all legacy .mov files in a directory to .mp4
//"-max_muxing_queue_size" source: https://trac.ffmpeg.org/ticket/6375
for FILENM in *;do ffmpeg -y -i $FILENM -crf 5 -max_muxing_queue_size 400 ${FILENM%.*}.mp4;done;
@lg3bass
lg3bass / UNIX > CURL > Download files by shell script(bash)
Last active January 17, 2018 16:26
Download a file using CURL and keep the existing filename.
//download a file (while keeping the filename)
curl -s -O 'http://abmedia.pearsoncmg.com/video/audio/mypsychlab/baron_0205205585/barron_5858_01_00.mp3'
//place a number of links you want to dl in a .sh file
#!/bin/sh
curl -s -O 'http://abmedia.pearsoncmg.com/video/audio/mydevelopmentlab/arnett_0205892493/01_adolescence_and_emerging_adulthood.mp3'
curl -s -O 'http://abmedia.pearsoncmg.com/video/audio/mydevelopmentlab/arnett_0205892493/01a_adolescence_and_emerging_adulthood.mp3'
//OUTPUT IF A URL EXISTS. ESSENTIALLY CHECKING IF THE RETURNED VALUE IS HTML CODE 200 OR NOT.
echo -e "IBM_Sells_PC.mp4 \t $(curl -Is http://export.mediaconsole.pearsoncmg.com/mdc/export/video/HE_BusPub/pearsonedu_upload_akamai_com/pandc/wild/IBM_Sells_PC.mp4 | head -1)" >> report.txt
-- best if run in a bbedit shellWorksheet as a stack of commands. e.g.
echo -e "http://export.mediaconsole.pearsoncmg.com/mdc/export/video/HE_BusPub/pearsonedu_upload_akamai_com/pandc/bp/2011/abc/090610_nwo_monminute_econom.srt $(curl -Is http://export.mediaconsole.pearsoncmg.com/mdc/export/video/HE_BusPub/pearsonedu_upload_akamai_com/pandc/bp/2011/abc/090610_nwo_monminute_econom.srt | head -1)" >> report.txt
echo -e "http://export.mediaconsole.pearsoncmg.com/mdc/export/video/HE_BusPub/pearsonedu_upload_akamai_com/pandc/bp/2011/abc/090724_2020_oil_pre.srt $(curl -Is http://export.mediaconsole.pearsoncmg.com/mdc/export/video/HE_BusPub/pearsonedu_upload_akamai_com/pandc/bp/2011/abc/090724_2020_oil_pre.srt | head -1)" >> re
//Use FFprobe to get data.
//source (and other things to query.)
https://trac.ffmpeg.org/wiki/FFprobeTips
//get the bitrate on a list of files.
for FILENM in *.flv; do ffprobe -v error -show_entries format=bit_rate -of csv $FILENM; done;
//result
format,509845
format,519899
format,504639
@lg3bass
lg3bass / ofGetAppPtrExample.md
Created June 8, 2017 12:47 — forked from jmsaavedra/ofGetAppPtrExample.md
example use of ofGetAppPtr()

###ofGetAppPtr() example

from a .cpp file, for example, "particle.cpp" you can do two things:

  • a) include "ofApp.h" (so you know what's inside the ofApp)
  • b) cast the ofGetAppPtr as a ptr

you can't include ofApp.h inside another .h file, as you would recursive includes (ie, ofApp includes particle, particle includes ofApp), but putting it in the .cpp is fine.

@lg3bass
lg3bass / gist:bde022cd2c6e694ca58a068a7d086dfd
Last active June 8, 2017 00:23
OF > create a OF project using the command line
LG3-MBP:~ lg3$ pwd
/Users/lg3
LG3-MBP:~ lg3$ ./Documents/OF/of_v0.9.8_osx_release/projectGenerator-osx/projectGenerator.app/Contents/Resources/app/app/projectGenerator -v -o"/Users/lg3/Documents/OF/of_v0.9.8_osx_release" -a"ofxAbletonLink,ofxAudioDecoder,ofxDatGui,ofxMSATimer,ofxOsc,ofxRange,ofxTextInputField,ofxTimecode,ofxTimeline,ofxTween,ofxXmlSettings" -p"osx" "/Users/lg3/Documents/OF/of_v0.9.8_osx_release/apps/myApps/test01"