Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
///////////////////////////////////////////////////// p5.js
var data;
var x = 100;
var y = 200;
function preload() {
data = loadTable('results.csv', 'header');
}
@lmccart
lmccart / index.html
Last active November 16, 2017 15:53
drag and drop with p5.js!
<html>
<head>
<script type="text/javascript" src="p5.js"></script>
<script type="text/javascript" src="p5.dom.js"></script>
<script type="text/javascript">
function setup() {
var c = createCanvas(400, 400);
devicePixelScaling(false);
background(0);
textSize(40);
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="https://l2.io/ip.js?var=userip"></script>
<meta charset="utf-8" />
</head>
@lmccart
lmccart / index.html
Created October 19, 2017 22:53
random order
<!DOCTYPE html>
<html>
<head>
<title>jQuery demo</title>
<link rel="stylesheet" href="style.css"></link>
<script src="jquery.js"></script>
<script src="main.js"></script>
</head>
<body>
<!-- delete any width and height info from url -->
///////////////////////////////////////////////////////////////////////
// JAVASCRIPT
// * JavaScript provides the ability to add interactivity to a website, and help enrich the user experience.
// * HTML provides a page with structure and CSS provides a page with style, JavaScript provide a page with behavior.
// * Like CSS, JavaScript should be saved in an external file with the .js file extension, and then referenced within
// an HTML document using the script element.
// <script src="script.js"></script>
// * Demo file setup
// * Demo console.log()
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<title>My Stylin Page</title>
<style>
p {
color: green;
font-size: 20px;
}
@lmccart
lmccart / gist:4a6cf3d92a7f00d32316
Last active September 28, 2017 18:24
face detection with processing and js
////////////////////////////////////////////////////////////////////
//// LIVE VIDEO
// Now we need the video library
import processing.video.*;
// Capture object
Capture img;
// New images from camera
// if mouse x
if (mouseX > width/2) {
background(0);
}
function setup() {
$('#something').hide();
$('#blah').fadeIn();
$('#mybutton').click(function() {
background(random(255));
})
}
function draw() {
ellipse(width/2 height/2, 50, 50);
createDataAnimation: function(filename) {
var me = this;
return function(p) {
var u = new utils(p);
var w = 640, h = 480;
var frameNumber = 0;