Category: Code

Posts related to code

Code, Jupyter, Notes

Convert Interactive Jupyter Notebook into a Website

Bla bla… here’s what you have to do: Install nbinteract: pip install nbinteract (even if you have anaconda installed, use pip) Create a git repo for your project – this is important otherwise nbinteract will NOT run Make your repo public Under settings, enable pages (so that you can host your code on your github.io) …

Code, Notes

Jupyter Notebook doesn’t Automatically Open a Browser on OS X

This issue appears to have showed up on Sierra. Here’s a simple fix: Edit your bash profile (emacs ~/.bash_profile) Add export BROWSER=open Close your shell or source it (source ~/.bash_profile) Things should get back to normal now. Ref: https://github.com/conda/conda/issues/5408

Code, Notes

How to Highlight Code in Keynote

First install a utility called highlight. It is available through macports and homebrew. sudo port install highlight Now that highlight is installed, you can “apply” it to a file and pipe it to the clipboard: highlight -O rtf MyCode.cpp | pbcopy Now go to Kenote and simply paste from clipboard (or command + v). Highlight …

Code, Notes

Convert Movie or Animation to Animated Gif

mkdir frames ffmpeg -i input -vf scale=320:-1:flags=lanczos,fps=10 frames/ffout%03d.png convert -loop 0 frames/ffout*.png -fuzz 20% -layers OptimizePlus output.gif Thanks to: http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality