Skip to content

Instantly share code, notes, and snippets.

View jeremyabel's full-sized avatar

Jeremy Abel jeremyabel

View GitHub Profile
@jeremyabel
jeremyabel / ue-delaunator.h
Last active October 27, 2018 02:49
UE Delaunator
// Represents the area outside of the triangulation.
// Halfedges on the convex hull (which don't have an adjacent halfedge)
// will have this value.
#define DELAUNATOR_INVALID_INDEX TNumericLimits<int32>::Max()
bool Orient(const FVector2D A, const FVector2D Q, const FVector2D R)
{
return (Q.Y - A.Y) * (R.X - Q.X) - (Q.X - A.X) * (R.Y - Q.Y) < 0.f
}
/**
* Class which handles the display of various palette-based move fx animations.
*
* These effects operate on a bitmap which stores a capture of the state of the screen,
* and then modifies the 4-color palettes used to draw specific areas of the screen.
*
* There are a number of palette effects available:
*
* INVERT: Inverts the palette's order.
* LIGHTEN1, 2, 3, 4: Lightens the palette, by 1, 2, 3, or 4 steps.
function NumRegUnico( obj, transaction ) {
console.log("Entering NumRegUnico");
return new Promise( ( resolve, reject ) => {
sql.connect( config ).then( recordsets => {
var request = new sql.Request( transaction );
request.output( 'NuevoNumReg', sql.char );
request.execute( 'dbo.uspNuevoRegistro' ).then( recordsets => {
@jeremyabel
jeremyabel / mysql.js
Last active September 15, 2017 04:13
function sendCotizacion(db, userName, productsObjArray, totalsObj, clientData, res, req) {
const pool = new sql.connect(config, err => {
console.log("err: " + err)
});
const transaction = new sql.Transaction(pool);
transaction.begin(err => {
if (err) {
console.log("err" + err);
}
@jeremyabel
jeremyabel / .block
Last active February 13, 2017 01:12 — forked from mbostock/.block
Delaunay Force Mesh II
license: gpl-3.0
var order, pathPoints, knots; // the regular stuff goes in these
var nSegments = 500;
var segments = [0], p0;
for (var i = 0; i <= nSegments; i++) {
var t = i / nSegments;
var p1 = bSpline(t, order, pathPoints, knots);
if (p0) {
var dx = p0[0] - p1[0];
@jeremyabel
jeremyabel / index
Created April 23, 2015 01:01
HSL Interpolation
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.space {
position: absolute;
@jeremyabel
jeremyabel / index.html
Created April 23, 2015 01:00
HSL Interpolation
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.space {
position: absolute;
@jeremyabel
jeremyabel / index.html
Last active August 29, 2015 14:19
HSL Interpolation
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.space {
position: absolute;