Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.23/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.23/addons/p5.dom.js"></script>
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<script>
var socket = io();
socket.on('chat message', function(msg){
createDiv(msg);
@lmccart
lmccart / extensions.js
Last active November 25, 2021 10:39
browser extension examples
/////////////////////////////////////////////////////////////////////////
//// MANIFEST
{
"manifest_version": 2,
"name": "Getting started example",
"description": "This extension shows a Google Image search result for the current page",
@lmccart
lmccart / mirror.js
Created February 16, 2016 01:07
Port of Processing Examples > Libraries > Video > Mirror to p5.js
// Port of Processing Examples > Libraries > Video > Mirror
// Size of each cell in the grid
var cellSize = 20;
// Number of columns and rows in our system
var cols, rows;
// Variable for capture device
var vid;
function setup() {
createCanvas(600, 600)
noFill();
stroke(255);
}
function draw() {
background(0, 10);
////////////////////////////////////////
//// BASIC BOX
function setup() {
createCanvas(600, 400, WEBGL);
}
function draw(){
background(0);
box();
//////////////////////////////////////////////////////////////////
//// touchX/Y DRAW
// Take a look at the HTML file where some things have been
// added for mobile viewing
function setup() {
// Make the canvas the size of the mobile device screen
createCanvas(windowWidth, windowHeight);
@lmccart
lmccart / main.js
Last active October 27, 2015 21:19
// Worker thread to help with massive pixel processing.
self.onmessage = function(event) {
if (event.data.hasOwnProperty("message")){
var message = event.data.message;
console.log("Worker got message ", event.data.message);
//////////////////////////////////////////////////
///////////////////////////////////// SOUND
//// 1. Click to toggle sound.
var song;
function preload() {
song = loadSound("sounds/beat.mp3");
var img;
function preload() {
img = loadImage('cat.jpg');
}
function setup() {
createCanvas(600, 400);
copy(img, 0, 0, 50, 50, 50, 50, 50, 50);
copy(img, 50, 50, 50, 50, 150, 150, 50, 50);
//// LOAD STRINGS PRELOAD
var lines;
function preload() {
lines = loadStrings("lines.txt");
}
function setup() {
createCanvas(600, 400);