This file contains 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
var roid, roid2, _i, _j, _len, _len2; | |
for (_i = 0, _len = asteroids.length; _i < _len; _i++) { | |
roid = asteroids[_i]; | |
for (_j = 0, _len2 = asteroids.length; _j < _len2; _j++) { | |
roid2 = asteroids[_j]; | |
if (roid !== roid2) { | |
if (roid.overlaps(roid2)) { | |
roid.explode(); | |
} | |
} |
This file contains 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
for roid in asteroids | |
for roid2 in asteroids when roid isnt roid2 | |
roid.explode() if roid.overlaps roid2 |
This file contains 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
grunt.initConfig({ | |
hogan: { | |
// desired target name | |
dev : { | |
// indicate you want to compile templates | |
compile : { | |
// wildcard of desired templates (glob syntax) | |
templates : "source/**/*.mustache", | |
processName: function(filename) { | |
return filename.replace(/source\//, "").replace(/\.jst\.mustache/, ""); |
This file contains 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> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> |
This file contains 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.after = (t,f) -> setTimeout f, t | |
window.every = (t,f) -> setInterval f, t | |
$ -> | |
alert "foo" | |
$('#canvas').attr | |
width: $('#canvas').width() | |
height: $('#canvas').height() | |
new Kata.Controller $('#canvas').get(0), 100 |
This file contains 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.Kata ?= {} | |
window.Kata.Controller = class Controller | |
constructor: (@canvas, particleCount) -> | |
@context = @canvas.getContext '2d' | |
@particles = [] | |
for i in [0...particleCount] | |
@particles.push new Kata.Particle(@context) | |
This file contains 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.Kata ?= {} | |
window.Kata.Particle = class Particle | |
constructor: (@context, @vector, @position) -> | |
@vector = | |
x: Math.random() * 4 - 2 | |
y: Math.random() * 4 - 2 | |
@position = | |
x: @context.canvas.width/2 | |
y: @context.canvas.height/2 |
This file contains 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
case @response | |
when Net::HTTPSuccess | |
... | |
else | |
... | |
This file contains 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
source 'https://rubygems.org' | |
# Guard | |
group :guard do | |
gem 'guard' | |
gem 'guard-coffeescript' | |
gem 'guard-haml' | |
gem 'guard-sass' |
This file contains 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
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
bind right:alt;cmd push right bar-resize:screenSizeX/2 | |
bind left:alt;cmd push left bar-resize:screenSizeX/2 | |
bind up:alt;cmd push up bar-resize:screenSizeY/2 | |
bind down:alt;cmd push down bar-resize:screenSizeY/2 | |
bind .:alt;cmd move 50;0 screenSizeX;screenSizeY |