Instantly share code, notes, and snippets.

View BezierLength.py
#%%
# Python implementation of Bezier curve length calculation using elliptic integrals
# as described in http://www.circuitwizard.de/metapost/arclength.pdf
from sympy import *
from sympy.integrals import integrate
from sympy.polys.polyroots import roots_quartic
from mpmath import *
View model_tag.rb
# Title: Include Model Tag for Jekyll
# Author: Max Eskin http://maxeskin.com
# Description: Import a 3D model saved in JSON format for display in a fancybox iframe.
#
# Syntax {% model key=value ... %}
#
# Keys:
# model - the filename of the model JSON
# thumb - the thumbnail image to display on the link
# title - the title to display under the model and in the title of the image
View modelframe.html
<html>
<head>
<title>Three.js JSON Loader Demo</title>
<script type="text/javascript" src="three.min.js"></script>
<script type="text/javascript" src="TrackballControls.js"></script>
<script type="text/javascript" src ="partloader.js"></script>
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
</head>
View partloader.js
// Some of this code is from http://www.radiatedpixel.com/wordpress/2013/03/27/webgl-3d-model-viewer-using-three-js/
// Other parts are from http://math.hws.edu/eck/cs424/notes2013/threejs/json-loader-demo.html
/* Uses JSONLoader to load objects that have been saved
* in three.js's json format. Requires the folder models-json
* that contains the seven sample models.
*/
var renderer; // A three.js WebGL or Canvas renderer.
var scene; // The 3D scene that will be rendered, containing the model.
View image_tag.rb
# Title: Simple Image tag for Jekyll
# Authors: Brandon Mathis http://brandonmathis.com
# Felix Schäfer, Frederic Hemberger, Max Eskin
# Description: Easily output images with optional class names, width, height, title and alt attributes
#
# Syntax {% include_poem key=value ... %}
#
# Most keys are mapped directly to img tag attributes except:
# caption - specifies a caption to be displayed below the image
# class - specifies CSS class for image or div if there's a caption
View include_poem.rb
# Title: Include Poem Tag for Jekyll
# Author: Max Eskin http://maxeskin.com
# Description: Import files on your filesystem into any blog post as embedded text snippets with line numbers.
#
# Syntax {% include_poem key=value ... %}
#
# Keys:
# left - Specifies file for left column (use this if only a single column is desired)
# right - File for right column
# title - Title