This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int x,y, xVelocity; // our three variables that we need to keep track of | |
void setup(){ | |
size(320,240); //size of the app | |
smooth(); // makes circles anti aliased | |
noStroke(); // means there is no outer line on our circle | |
fill(100,100,150); // the colour of the ball | |
background(240); // the background | |
xVelocity = 1; | |
x = width/2; // width is the width of the sketch its always available | |
y = height/2; // same with height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place all the behaviors and hooks related to the matching controller here. | |
# All this logic will automatically be available in application.js. | |
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | |
window.sketch = (p5)-> | |
p5.setup = -> | |
p5.size $(window).width(),$(window).height() | |
p5.background 0x000033 | |
p5.smooth() | |
p5.rectMode p5.CENTER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function(){ | |
var display = document.getElementsByTagName("body"); //could be any element | |
var touched = false; // a useful flag for restructing otehr actions | |
var increment = 0; // the amount we increment | |
var addRotateTouches = function(){ | |
display.addEventListener("touchstart", rotateStart ,false); | |
display.addEventListener("touchmove", rotateMove ,false); | |
display.addEventListener("touchend", rotateEnd ,false); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE> | |
<html> | |
<head> | |
<title>Link sorter</title> | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> | |
<style> | |
a, input{ | |
margin:5px; | |
padding:10px; | |
font-family:sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function store_in_msg_table($message){ | |
$message = mysql_real_escape_string($message); | |
openconn(); | |
$sql = ''; | |
if(!mysql_num_rows( mysql_query("SHOW TABLES LIKE 'email_store'"))){ | |
$sql = "CREATE TABLE 'email_store' ('id' INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 'message' TEXT NOT NULL , 'date_sent' TIMESTAMP NOT NULL);"; | |
mysql_query($sql) or die(mysql_error()); | |
} | |
$sql = 'INSERT INTO email_store (message) values ("'.$message.'");'; | |
mysql_query($sql) or die(mysql_error()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
allLinks = $ '.links li a' | |
linksContaing = (searchString)-> | |
$(".links li a:contains('#{searchString}'), .links li a.#{searchString}") | |
displayLinks = -> | |
searchString = $(@).val() | |
if searchString is '' | |
allLinks.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blob | |
constructor: (@x, @y, @app)-> | |
@xAcceleration = Math.random() - 0.5 | |
@yAcceleration = Math.random() - 0.5 | |
draw: => | |
@x += @xAcceleration | |
@y += @yAcceleration | |
@x = -5 if @x > @app.width + 5 | |
@x = @app.width + 5 if @x < -5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So it's going to be a book cataloging inputs to computers and touch devices. | |
- how to find a new kind of input | |
examine the real world | |
what do we already use/do | |
what could be expressed better | |
the introduction of analogue | |
the introduction of the mouse | |
kinect | |
new things are rubbish discomfort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
value = 10 | |
targetValue = 20 | |
speed = 0.1 | |
loop = -> | |
value += (value - targetValue)* speed | |
requestAnimationFrame loop unless Math.abs(targetValue - value) < 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScrollTracker | |
constructor: -> | |
$(window).scroll @scroll | |
@targets = $ '.targets' | |
@sensitivity = 20 | |
showNavFor: (target)=> | |
name = $(target).attr 'name' | |
$('.active').removeClass 'active' | |
$("a[href=##{name}]").addClass('active'); |
OlderNewer