Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
@lmccart
lmccart / gist:ee86d58f2c012145215a
Last active August 29, 2015 14:14
add your name to readme
  1. Go to http://github.com/lmccart/itp-critical-apis, and click the "Fork" button.
  2. You will see a "forking..." animation, then you will end up at your own forked version of the class repository. Click the link to the file "README.md".
  3. To edit the file, click the pencil icon in the upper right. Edit the file adding your name, then hit "Commit changes" at the bottom of the page (it's ok to leave the description field blank).
  4. On the right hand side of the page, click the "Pull requests" icon.
  5. Click the "Create pull request" button at the top of the page. Submit the form, and you're done!
var notes = [];
var gridEdge = 40;
function setup() {
createCanvas(400, 400);
stroke(255);
fill(0);
}
<html>
<head>
<style>
#pic {
width: 200;
height: 200;
position: absolute;
}
#overlay {
opacity: 0;
@lmccart
lmccart / gist:4af70334699aea5afacd
Last active August 29, 2015 14:09
calculate the average color of an image
var img;
var avgColor = [0, 0, 0, 0];
function setup() {
createCanvas(400, 400);
img = loadImage('cat.jpg', getAverageColor);
}
function getAverageColor() {
@lmccart
lmccart / gist:2ca1b2bb13e3a8d02f43
Created November 11, 2014 19:52
centered image example
<html>
<head>
<style>
#centered {
width: 100px;
margin: 300px auto; // top offset 300px, side margin auto (centered)
}
</style>
@lmccart
lmccart / content_script.js
Created November 10, 2014 23:01
popup to main tab inject (chrome extension)
$("#change").click(function() {
$.ajax({
url: "http://api.openweathermap.org/data/2.5/weather?id=5128581&units=imperial",
dataType: 'json',
success: function(data) {
changeMainPage(data);
},
@lmccart
lmccart / gist:2273a047874939ad8ad1
Last active February 18, 2024 21:57
p5.js + p5.dom.js + clmtracker.js
<html>
<head>
<script src="clmtrackr.js"></script>
<script src="model_pca_20_svm.js"></script>
<script src="p5.js"></script>
<script src="p5.dom.js"></script>
<script>
var ctracker;
@lmccart
lmccart / gist:957ea74708d857e44d5e
Last active August 29, 2015 14:08
New Topics in Social Computing: Emotional labor and affective computing
@lmccart
lmccart / gist:253c4df01ff09ea5ddb4
Created October 15, 2014 14:44
instance mode with noCanvas p5
var s0 = function(p) {
p.setup = function() {
p.createCanvas(200, 200);
p.noCanvas();
p.frameRate(1);
}
p.draw = function() {
p.print(p.floor(10.3));
};
};
0,.000,1.000,.000,Undefined,1.000,Undefined
1,.017,1.000,.017,57.290,1.000,57.299
2,.035,.999,.035,28.636,1.001,28.654
3,.052,.999,.052,19.081,1.001,19.107
4,.070,.998,.070,14.301,1.002,14.336
5,.087,.996,.087,11.430,1.004,11.474
6,.105,.995,.105,9.514,1.006,9.567
7,.122,.993,.123,8.144,1.008,8.206
8,.139,.990,.141,7.115,1.010,7.185
9,.156,.988,.158,6.314,1.012,6.392