Skip to content

Instantly share code, notes, and snippets.

View catarak's full-sized avatar
🌈
it's a unix system, i know this

Cassie Tarakajian catarak

🌈
it's a unix system, i know this
View GitHub Profile
@catarak
catarak / Makefile
Last active August 29, 2015 14:01
Battleship
# Cassie Tarakajian, ctarakajian@gmail.com
CXXFLAGS=-pedantic -Wall -Wextra -std=c++11 -Wabi -Weffc++ -Wctor-dtor-privacy -Wold-style-cast -Woverloaded-virtual -Wsign-promo
all: battle
battle: battle.cc ship.o board.o ocean_board.o target_board.o computer_player.o game_manager.o
ship.o: ship.h ship.cc
board.o: board.h ship.h board.cc
@catarak
catarak / app.py
Last active March 6, 2016 17:46
Partial Server-Side code for water level meter
from flask import Flask, jsonify
import threading
import time
import requests
import json
app = Flask(__name__)
max_num_entries = 25
current_entry = 0
#this array will store the last 25 values of the water meter
{
"Version": "2008-10-17",
"Id": "Policy1397632521960",
"Statement": [
{
"Sid": "Stmt1397633323327",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},

Day 1

Start with Cassie

  • Ahead of time - download p5.js desktop editor
  • Set expectations - learn to code through making interactive and generative art
  • What is p5.js? What does the .js mean? Show some examples interactive, generative art. (http://leslieruckman.tumblr.com/)
  • What is code? Briefly mention that code is a series of instructions, executed sequentially.
  • Stay within setup(). Talk about how to draw simple shapes, coordinate system, stroke, fill, background
    • exercise - draw three shapes, snowman
  • Talk about draw(). Discuss frames, 30 f/s minimum, etc. Throw in the word loop.
  • code inside is getting executed over and over again, but at a fixed rate, every 1/60th of a second
Set expectations - This workshop is going to teach you the basics of JavaScript though creative coding.
What is p5.js? It is a library of JavaScript to draw, making static, animated, interactive or generative visuals. You can include sounds, images, text, you can interact with HTML, you can make graphs, you can interact with sensors, you can use physics. You can do lots and lots of things. You can use other libraries. It is awesome.
It is an open source library, which means that all of its code is free and available to anyone. It was created by Lauren McCarthy and is supported by the Processing Foundation.
http://www.leslieruckman.com/ITP2016/100DaysOfMaking/Day47/
http://www.leslieruckman.com/ITP2016/100DaysOfMaking/Day72/
http://www.leslieruckman.com/ITP2016/100DaysOfMaking/Day32/
http://www.leslieruckman.com/ITP2016/100DaysOfMaking/Day9/
http://xie-emily.com/generative_art/noise_art.html
// ONE
function Agent() {
this.position = createVector(random(width), random(height));
}
Agent.prototype.update = function() {
ellipse(this.position.x, this.position.y, 50, 50);
}
function setup() {
createCanvas(400, 400);
noStroke();
background(220);
}
function draw() {
var xColor = map(mouseX, 0, width, 0, 255);
var yColor = map(mouseY, 0, height, 0, 255);
fill(xColor, yColor, 200);
var capture;
var stepSize = 5;
function setup() {
createCanvas(400, 300);
capture = createCapture(VIDEO);
capture.size(400, 300);
capture.hide();
rectMode(CENTER);
noStroke();
var video;
var x = 0;
function setup() {
createCanvas(800, 240);
pixelDensity(1);
video = createCapture(VIDEO);
video.size(320, 240);
module.exports = function(options) {
var seneca = this;
seneca.add({role:'todo', cmd:'create', createTodo);
function createTodo(args, done) {
var todoText = args.text;
// ... perform todo creation
done(null, todo);
}
}