Skip to content

Instantly share code, notes, and snippets.

@ryanthejuggler
ryanthejuggler / index.html
Created July 30, 2014 16:16
Fun delete confirmation
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Delete button demo</title>
<script type="text/javascript" src="//jsfiddle.net/js/coffeescript/coffeescript.js"></script>
<script type='text/javascript' src='//code.jquery.com/jquery-2.1.0.js'></script>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootswatch/3.2.0/spacelab/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">
@ryanthejuggler
ryanthejuggler / README.md
Last active August 29, 2015 13:59
To-do app static content

This is the static content for my todo-app tutorial using Apache, OpenID, and Node.

@ryanthejuggler
ryanthejuggler / README.md
Last active August 29, 2015 13:59
Data clustering
@ryanthejuggler
ryanthejuggler / caffeine.js
Created March 25, 2014 15:11
Blood caffeine concentration estimate
var duration = 24*3600*1000; // 24 hours as milliseconds
var halfLife = 5*3600*1000; // 5 hours as milliseconds
var absorpLife = 3600*1000; // 1 hour as milliseconds
var end = +(new Date());
var start = end - duration;
var numSteps = 24*60;
var step = duration/numSteps;
var startVal = 106;
var rows = [];
var log2 = Math.log(2);
@ryanthejuggler
ryanthejuggler / testgen.js
Created February 6, 2014 02:25
G-code test generator
// usage: node testgen.js > myFile.g
// alter the below variables to taste!
var ORIGIN = [0,0];
var EXTENT = 90;
var NUM_LOOPS = 20;
var POINTS_PER_LOOP = 100;
var SPEED=20000;
var MAX_HEIGHT=250;
var i, theta, r, h;
@ryanthejuggler
ryanthejuggler / data.js
Created December 5, 2013 03:10
US Data Visualization (with fake data)
var us;
var stateNames = {};
var stateIds = {};
var stateNamesByAbbr = {};
var stateAbbrById = {};
var g;
var data = {};
var year = 2013;
server {
listen 80;
server_name thoughts.muller.io;
location /favicon.ico {
alias /var/www/trophy.png.ico;
}
location / {
start on startup
script
/path/to/important/script.sh
end script
@ryanthejuggler
ryanthejuggler / openglgeom.cpp
Last active December 10, 2015 22:59
Creating OpenGL geometry
Patch *front = new Patch(g);
for (int i = 0; i < k; ++i)
front->addQuad(outside[i], inside[i],
inside[(i + 1) % k], outside[(i + 1) % k]);
@ryanthejuggler
ryanthejuggler / splinterp.cpp
Created November 22, 2012 16:55
C++ cubic spline interpolation
#include <std::vector>
#include <opencv2/core/core.hpp>
#include <iostream>
#include <stdio.h>
/*
This work by Ryan Muller released under the Creative Commons CC0 License
http://creativecommons.org/publicdomain/zero/1.0/
*/
/**