Skip to content

Instantly share code, notes, and snippets.

View sebastiandeutsch's full-sized avatar

Sebastian Deutsch sebastiandeutsch

View GitHub Profile
source 'https://rubygems.org'
# Guard
group :guard do
gem 'guard'
gem 'guard-coffeescript'
gem 'guard-haml'
gem 'guard-sass'
case @response
when Net::HTTPSuccess
...
else
...
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
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)
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
<!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="">
@sebastiandeutsch
sebastiandeutsch / gist:4136265
Created November 23, 2012 16:05
hogan/mustache compile task for grunt
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/, "");
for roid in asteroids
for roid2 in asteroids when roid isnt roid2
roid.explode() if roid.overlaps roid2
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();
}
}
### Keybase proof
I hereby claim:
* I am sebastiandeutsch on github.
* I am sippndipp (https://keybase.io/sippndipp) on keybase.
* I have a public key whose fingerprint is 43E1 2E79 7907 07A8 1C78 3484 3D44 6B59 C0C5 8CBB
To claim this, I am signing this object: