Skip to content

Instantly share code, notes, and snippets.

@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
@lg3bass
lg3bass / UNIX_FFMPEG_createThumbs.txt
Last active February 14, 2017 14:17
UNIX>FFMPEG(and others)>Create Thumbnails of video frames.
//2017 - more up to date infor for using ffmpeg.
https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video
//use ffmpeg to create thumbnails
ffmpeg -f image2 -i image%d.jpg video.mpg
//http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
//use ffmpeg to convert video with passthru encoding
@lg3bass
lg3bass / KHA
Created February 6, 2017 17:32
KHA NOTES
//updating KHA
//option 1:
sudo haxelib upgrade
//option 2:
sudo git submodule foreach --recursive git pull origin master
@lg3bass
lg3bass / gist:0c838604c99fc357af6921d1c33292a0
Created November 14, 2016 15:09
Start simple http-server on NPM
https://www.youtube.com/watch?v=d3OcFexe9Ik&index=2&list=PLRqwX-V7Uu6aoeLx_mWfz6XwtFaD9SkVX
//installing "http-server" package.
sudo npm install http-server -g
//running server.
USRLSML-2HLDV7L:npm_test uwhitbo$ http-server
Starting up http-server, serving ./
Available on:
http://127.0.0.1:8080
((ofApp*)ofGetAppPtr())->[FUNCTION OR CLASS]
@lg3bass
lg3bass / UNIX>private>etc>hosts
Last active September 21, 2016 13:42
Add exceptions to the /private/etc/hosts
// source: https://support.rackspace.com/how-to/modify-your-hosts-file/
// set the hosts file on a mac
//Mac OS X 10.6 through 10.11
//1. Open Applications > Utilities > Terminal.
//2. Open the hosts file by typing the following line in the terminal window:
USRLSML-2HLDV7L:etc uwhitbo$ sudo nano /private/etc/hosts
Password:
@lg3bass
lg3bass / UNIX > zip
Created September 21, 2016 04:06
Create a zip of all the files in a directory minus invisibles and .json
// create a zip of all the files in a directory minus the .DS store and .__MACOS. also exclude all .json
USRLSML-2HLDV7L:08_oddityWierdArms03_11-110_OBJ_Seq uwhitbo$ zip -r -X test.zip * -x "*.json"
adding: oddityWierdArms03_11-110.0000.obj (deflated 8%)
adding: oddityWierdArms03_11-110.0001.obj (deflated 70%)
adding: oddityWierdArms03_11-110.0002.obj (deflated 68%)
adding: oddityWierdArms03_11-110.0003.obj (deflated 68%)
@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)
//source: https://www.youtube.com/watch?v=Ads1A7pn2LI
//initialize npm and setup package.json
USRLSML-2HLDV7L:myproject uwhitbo$ npm init
//create index.js file. For now just put in simple js code.
console.log("hi");
//test to make sure node is working
USRLSML-2HLDV7L:myproject uwhitbo$ node index.js