Skip to content

Instantly share code, notes, and snippets.

View gordonwoodhull's full-sized avatar
🖋️
learning

Gordon Woodhull gordonwoodhull

🖋️
learning
View GitHub Profile
@gordonwoodhull
gordonwoodhull / readme.md
Last active December 23, 2015 06:59 — forked from jlewin/readme.md

Want to fork your own gists? No fork button? No problem! Install this user script by clicking refork.user.js' "raw" link down below:

Starting with Chrome 21, userscript installation is blocked on all sites other than the Chrome Web Store. The new approach requires the user to download the script file and drag & drop it into the Extensions tab.

GW - updated to URL changes of 2013 which add the username

@gordonwoodhull
gordonwoodhull / gvparse.hpp
Last active August 29, 2015 14:22
Parse graphviz graph description at C++ compile time using metaparse! (incomplete)
#define MPLLIBS_LIMIT_SEQUENCE_SIZE 7
#define MPLLIBS_LIMIT_STRING_SIZE 256
#include <mpllibs/metaparse/string.hpp>
#include <mpllibs/metaparse/keyword.hpp>
#include <mpllibs/metaparse/token.hpp>
#include <mpllibs/metaparse/lit_c.hpp>
#include <mpllibs/metaparse/any.hpp>
#include <mpllibs/metaparse/alphanum.hpp>
#include <mpllibs/metaparse/sequence.hpp>
// Adapted from http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/1968345#1968345
var eps = 0.0000001;
function between(a, b, c) {
return a-eps <= b && b <= c+eps;
}
function segment_intersection(x1,y1,x2,y2, x3,y3,x4,y4) {
var x=((x1*y2-y1*x2)*(x3-x4)-(x1-x2)*(x3*y4-y3*x4)) /
((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));
var y=((x1*y2-y1*x2)*(y3-y4)-(y1-y2)*(x3*y4-y3*x4)) /
((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4));
@gordonwoodhull
gordonwoodhull / .block
Last active October 9, 2018 16:58
dc.js example
license: mit
@gordonwoodhull
gordonwoodhull / .block
Last active May 11, 2018 21:25
dc.js example
license: mit
@gordonwoodhull
gordonwoodhull / .block
Created February 20, 2016 06:06
N-Body Problem
license: gpl-3.0
@gordonwoodhull
gordonwoodhull / .block
Last active February 20, 2016 06:14 — forked from mbostock/.block
N-Body Problem
license: gpl-3.0
@gordonwoodhull
gordonwoodhull / .block
Last active September 13, 2016 08:06
fresh block
license: mit
@gordonwoodhull
gordonwoodhull / .block
Last active September 13, 2016 08:11
fresh block
license: mit
@gordonwoodhull
gordonwoodhull / .block
Last active December 4, 2016 12:32 — forked from d3noob/bootstrap.min.css
dc.js chart examples
license: mit