Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
@lmccart
lmccart / printer-example.js
Created May 21, 2018 21:19
printer-example.js
// https://github.com/song940/node-escpos
var path = require('path');
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var escpos = require('escpos');
process.on('uncaughtException', function (err) {
@lmccart
lmccart / timetest.js
Created May 9, 2018 21:39
timetest.js
// library to use: https://momentjs.com/docs/#/query/
var data = [{ts: "5/8/blah" , secret:"i washed jeans", value:"immediately"}, {}];
function getAllReady(arr) {
var newArr = [];
for (var i=0; i<data.length; i++) {
var now = new Date().getTime();
var ts = data[i].ts;
///////////////////////////////////////////////////// p5.js
var data;
var x = 100;
var y = 200;
function preload() {
data = loadTable('results.csv', 'header');
}
<!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 -->
<!DOCTYPE html>
<html>
<head>
<title>My Stylin Page</title>
<style>
p {
color: green;
font-size: 20px;
}
// if mouse x
if (mouseX > width/2) {
background(0);
}
createDataAnimation: function(filename) {
var me = this;
return function(p) {
var u = new utils(p);
var w = 640, h = 480;
var frameNumber = 0;
///////////////////////////////////////////////////////////////////////
// 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>
/////////////////// 01_WIDTH UNITS
<!DOCTYPE html>
<html>
<head>
<title>CSS layout</title>
<link rel="stylesheet" href="style.css"></link>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer maximus ipsum urna. Suspendisse sit amet scelerisque tellus. Aenean tempus, purus in dictum luctus, purus odio dapibus ipsum, et maximus neque sapien eget ex. Quisque urna nibh, commodo non enim at, lobortis ultricies diam. Sed lectus arcu, sodales vitae mollis nec, luctus nec arcu. Vestibulum neque mi, tristique eu commodo et, commodo efficitur turpis. Pellentesque commodo libero velit, a vestibulum urna fermentum id. Suspendisse interdum nibh nibh, ac feugiat velit condimentum sit amet. Vivamus non arcu sit amet massa malesuada placerat lobortis in massa. Duis porta vehicula maximus.</p>