This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: Yotam Gingold <yotam (strudel) yotamgingold.com> | |
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/) | |
Description: An `asarray` function that wraps a cffi pointer in a numpy.array. | |
URL: https://gist.github.com/yig/77667e676163bbfc6c44af02657618a6 | |
''' | |
from __future__ import print_function, division | |
import numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Author: Yotam Gingold <yotam (strudel) yotamgingold.com> | |
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/) | |
Description: Creates the simplest possible static HTML image gallery for a set of images. Just the images with CSS max-width, max-height, and padding. Thumbnails optional. | |
URL: https://gist.github.com/yig/1bab9c01806625237f1656e44667dd9a/ | |
''' | |
from __future__ import division, print_function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: Yotam Gingold <yotam (strudel) yotamgingold.com> | |
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/) | |
''' | |
from __future__ import print_function, division | |
from numpy import * | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Depends on: | |
// Blob: http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js | |
// canvas.toBlobHD: http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js | |
function saveScreenshot( filename ) | |
{ | |
/// Open in a new window. | |
// var kMIMEType = "image/png"; | |
// var dataURL = renderer.domElement.toDataURL( kMIMEType ); | |
// window.open( dataURL ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
''' | |
Author: Yotam Gingold <yotam (strudel) yotamgingold.com> | |
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/) | |
Description: Create PNG thumbnails for OBJ files on OS X using built-in QuickLook (and ImageMagick `mogrify` to trim them afterwards). | |
''' | |
for obj_file in "$@"; do | |
## qlmanage comes with OS X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: Yotam Gingold <yotam (strudel) yotamgingold.com> | |
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/) | |
''' | |
from __future__ import print_function, division | |
from numpy import * | |
from skimage import color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% The typical answer for how to eliminate white space in wrapfigure doesn't work for me (I'm using a SIGGRAPH style sheet): | |
%% http://tex.stackexchange.com/questions/111393/too-much-space-around-wrap-figure | |
%% Instead, let's just offset the image. | |
%% The horizontal white space is \columnsep and the vertical white space is \intextsep. | |
%% Subtract them from the column width and offset the image accordingly. | |
%% How to move an image: | |
%% http://tex.stackexchange.com/questions/107340/how-to-shift-graphics-adjust-placement-of-figure-with-includegraphics | |
\begin{wrapfigure}[11]{R}{1in - .75\columnsep} | |
%\centering | |
\vspace{-\intextsep} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Depends on Handbrake command line tool, which you can download as a binary: https://handbrake.fr/downloads2.php | |
## This script calls it recursively on all videos found. As a one off, the command is: | |
# HandBrakeCLI -i path/to/input -o path/to/output.mp4' -O --preset 'Normal' --crop 0:0:0:0 | |
usage() | |
{ | |
echo 1>&2 "Usage:" "$0" 'path/to/video/dir1 [path/to/video/dir2 ...]' | |
exit -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## I used cfxr to create a coin sound. afplay is an OS X command line sound playback tool. | |
DING='afplay -v .01 /mixed\ media/music/cfxr\ coin.wav' | |
## Silence the ding. | |
# DING='' | |
## Simple continuous ding with draft mode followed by a batch mode run which actually generates the PDF. | |
## Copies the PDF with the suffix -copy.pdf, so that live-updating PDF viewers don't choke trying to load the PDF while it is still being written. | |
### We can't distinguish between the first time latexmk launches the viewer regardless of changes and later launches of the viewer with changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Simple draft mode followed by pdflatex once by using the print hook. | |
## With no arguments, it will follow a 'latexmkrc' file if there is one. | |
## You still get the nice error messages at the end: | |
latexmk -pdf -pdflatex='pdflatex -draftmode %O %S && touch %D' -print=pdf -e '$lpr_pdf=q|pdflatex -interaction=batchmode -synctex=1 %R|' "$@" |