Skip to content

Instantly share code, notes, and snippets.

@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
@lg3bass
lg3bass / GitCommands.txt
Last active January 30, 2018 03:48
MyGitList
//Create a new git repo. Concise instruction right from Git.
//Use this BOB!!!!!!!!!
//https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
//http://stackoverflow.com/questions/3311774/how-to-convert-existing-non-empty-directory-into-a-git-working-directory-and-pus
//RESOURCES:
//http://rogerdudler.github.io/git-guide/
//assuming your remote branch is up-to-date. Get rid of all your local changes and revert back to what is on the server.
git checkout -- .
@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'
@lg3bass
lg3bass / gist:7c1b727825886b5155e70e0570acefbe
Last active December 28, 2017 19:29
XSLT>XML-TREE(chrome extension) EXAMPLES
//METHOD : select nodes in the extension.
//TIP: If you hover over any of the xml nodes and click on of them you will see the xpath in the extension window.
// Next with the path in the window, Click "XPath/Parse" to the right.
// This will display all the nodes at that path.
// e.g. source: https://hssmedia.pearsoncmg.com/chapter_audio/data/hss_kagan_westernheritage_11/data.xml
// e.g. xpath : /audiobook/chapters/chapter/entry/file
// e.g. result: listing of all the mp3 files. (you may have to scroll down)
//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
@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 / 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"
@lg3bass
lg3bass / OF > compile with Cmake
Created March 13, 2017 15:52
How to compile OF from the command line so you can break up with xcode and use atom or sublime
//source: https://forum.openframeworks.cc/t/how-to-compile-of-from-the-command-line-so-you-can-break-up-with-xcode-and-use-atom-or-sublime/26137
If so, here's a handy guide. It's super dead simple.
Go install atom if you haven't now. This should also work for sublime, or even VIM.
Add OF to your system's path. To do this you need to find a hidden file. Open up terminal and use this unix command to do it. Steps 3-5 will walk you through it.
Open terminal and simply cd and press enter
@lg3bass
lg3bass / gist:4a9db2d39511810df3ca1467008a46e3
Created February 22, 2017 17:11
FFMPEG > embed .srt in .mp4 (for Quicktime only)
//ISSUE: Quicktime sometimes doesn't play .srt files even if they are named the exact same thing in the same folder.
//SOLUTION: Use ffmpeg to add metadata to the .mp4 container and embed the .srt file.
This process is lossless as we use a passthrough encoder.
//note. this process is similar to the .m4v container and embedding .srt files.
//SOURCE: https://discussions.apple.com/thread/2115778?tstart=0
ffmpeg -i video.mp4 -i sub.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng out.mp4