Skip to content

Instantly share code, notes, and snippets.

View bmoren's full-sized avatar

Ben Moren bmoren

View GitHub Profile
@bmoren
bmoren / lightbikegame.pde
Last active August 29, 2015 14:10
a simple 2 player lightbike game in processing using WASD and ARROW Keys
///a simple 2 player lightbike game in processing using WASD and Arrow Keys.
//game params
int speed = 4;
int playerSize = speed + 1 ;
color p1color = color(255, 255, 0); //must have green for detection
color p2color = color(0, 255, 255); //must have green for detection
//player alive?
int player1status = 1;
@bmoren
bmoren / webcam.html
Created October 21, 2014 15:23
HTML5 Webcam
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="stuff, to, help, search, engines, not" name="keywords">
<meta content="What this page is about." name="description">
<meta content="Display Webcam Stream" name="title">
<title>Display Webcam Stream</title>
<style>
@bmoren
bmoren / grid.html
Created October 20, 2014 23:20
CSS/ HTML Grid of 9 points
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style type="text/css" media="screen">
html{height:100%;}
body{height:100%;}
@bmoren
bmoren / app.js
Last active August 29, 2015 14:07
jQuery Getting Started
/*
We are going to look at a number of different jQuery methods and a small amount of basic javascript so hold on to your horses!
please search for these methods in the jQuery API: http://api.jquery.com/
.addClass()
.removeClass()
.html()
.css()
.fadeIn() / .fadeOut()
void setup() {
size(320,320);
frameRate(30);
}
void draw() {
// set background to black
background(0);
// get my current time values
@bmoren
bmoren / for_loop.js
Last active August 29, 2015 14:06
Generative JS Snippets
//set an an amount to loop through (this is often an array called with array.length)
// the for loop, set a varioable called 'i' to 0, as long as 'i' is less than the variable amount, then increase 'i' by after it executes the code in the curly braces each time
for (var i=0; i<amount; i++){
//do stuff here
//do something each time!
console.log("this is iteration #" + i + " through the for loop");
// example to append a thing 10 times
$('.theCount').append("<p class='underline'>iteration #" + i + "</p>");
@bmoren
bmoren / basic_response.php
Last active August 29, 2015 14:06
Twilio Rest SMS reply
<?php>
//~~~~~~~~~~~~~~~BASIC RESPONSE EXAMPLE ~~~~~~~~~~~~~//
$client = new Services_Twilio($AccountSid, $AuthToken);
$body = $inbody . "" . ":and the PHP added ME!" ;
$message = $client->account->sms_messages->create($from, $to, $body);
<?>