###puckhead.nodejitsu.com
A two-player air hockey game where you move your mallet with your head!
###How to use:
- Allow webcam usage in browser
| license: gpl-3.0 | |
| border: no | |
| height: 2000 |
| /* | |
| The main function for finding elements by CSS selector. It checks which type | |
| of selector is being passed in, then either finds the elements right there or | |
| calls a helper function to find the elements. | |
| */ | |
| var findElements = function (selector) { | |
| if (selector[0] === ".") { | |
| return document.getElementsByClassName(selector.slice(1)); | |
| } | |
| else if (selector[0] === "#") { |
| var testArray = [[0,3], [2,2], [1,1], [1,1]]; | |
| //This is the main function, which calls the helper functions. | |
| var drawHistogram = function(array){ | |
| //These two steps prepare the inputs for the block that actually draws the histogram. | |
| var combinedHeightsArray = combineHeights(array); | |
| var orderedArray = orderAndFlattenArray(combinedHeightsArray); | |
| //Drawing the histogram. The max height determines how many times drawLine is called. | |
| //It draws the lines from the top down. |
| info: Welcome to Nodejitsu coleman | |
| info: jitsu v0.12.8, node v0.8.21 | |
| info: It worked if it ends with Nodejitsu ok | |
| info: Executing command deploy | |
| info: Analyzing application dependencies in node server.js | |
| warn: Local package version appears to be old | |
| warn: The package.json version will be incremented automatically | |
| warn: About to write /Users/colemanfoley/code/playlist-me/public/playlist-me-helper/package.json | |
| data: | |
| data: { |
| #!/usr/bin/env ruby | |
| require 'open-uri' | |
| require 'json' | |
| raw = open('http://api.wunderground.com/api/59431618fd2e7dae/geolookup/conditions/q/CA/Yuba_City.json').read | |
| processed = JSON.parse(raw) | |
| yuba_city = processed['current_observation'] | |
| puts "Yuba City is " + yuba_city['feelslike_string'] |
| class Shape | |
| def get_color | |
| return color | |
| end | |
| def set_color(color) | |
| @color = color | |
| end | |
| def can_fit?(shape) |
| def print_grid(x = 5, y =5) | |
| row_0 = "00000" | |
| row_1 = "00000" | |
| row_2 = "00000" | |
| row_3 = "00000" | |
| row_4 = "00000" | |
| if y == 0 | |
| row_0[x] = "X" |
| module InWords | |
| #The method for turning integers 1-19 into the appropriate strings. | |
| def under20 | |
| array_under20 = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] | |
| return array_under20[self] | |
| end | |
| #The method for turning integers 20-99 into the appropriate strings. | |
| def under100 |
| class Book | |
| attr_accessor :title | |
| def initialize | |
| @title = "" | |
| end | |
| def title=(new_title) | |
| fixed_title = "" | |
| title_array = new_title.split | |
| title_array.each do |word| |