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
/* | |
Geometry Library | |
All angles are in radian measurements | |
*/ | |
// Point Object | |
function Point(x, y) { | |
this.x = x; | |
this.y = y; | |
}; |
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
registerEntity('player', { | |
poly: [[100, 100], [200, 100], [100, 200]], | |
init: function(that) { | |
}, | |
render: function(that) { | |
ctx.strokeStyle = '#fff'; | |
canvasUtils.drawPolygon(that.poly); | |
} | |
}); |
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
/* | |
Geometry Library | |
All angles are in radian measurements | |
*/ | |
// Point Object | |
function Point(x, y) { | |
if (x.length === undefined) { | |
this.x = x; | |
this.y = y; |
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
var generated = false; | |
var currentNote = false; | |
var bpm = 600; | |
var sequence = [ | |
squareWave(50, 0.1), | |
sineWave(440, 0.4), | |
squareWave(50, 0.1), | |
sineWave(540, 0.4), | |
squareWave(50, 0.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
#!/bin/sh | |
echo "# Downloading latest.tar.gz" | |
wget wordpress.org/latest.tar.gz | |
echo "# Extracting" | |
tar -xf latest.tar.gz | |
echo "# Cleaning Up" | |
mv wordpress/* . | |
rm -r wordpress | |
echo "# Setting up mysql" | |
mysql -u root -p -e "create database $1db; grant usage on *.* to $1user@localhost identified by '$2'; grant all privileges on $1db.* to $1user@localhost;" |
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
jQuery(function($) { | |
function Demo() { | |
var i, j; | |
$('html').css('perspective', '2000px'); | |
$('body').css({'transition': 'transform 0.1s ease-out'}); | |
var mousePos = {}; | |
$(window).mousemove(function(e) { | |
mousePos.x = e.clientX; | |
mousePos.y = e.clientY; | |
}); |
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
var actx = new AudioContext(); | |
var sound = actx.createBufferSource(); | |
var req = new XMLHttpRequest(); | |
var audioFile = 'https://dl.dropboxusercontent.com/u/87705298/136351__djmastah__requiem-3.mp3'; | |
req.open('GET', audioFile, true); req.responseType = 'arraybuffer'; | |
req.onload = function() { | |
actx.decodeAudioData(req.response, function(buffer) { | |
sound.buffer = buffer; |
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
(def start-grid [[0 0 0 0 0 1 0 0 0 0] | |
[0 0 0 0 1 0 0 0 0 0] | |
[0 0 0 0 1 0 0 0 1 0] | |
[0 0 0 0 0 0 0 0 1 0] | |
[0 0 0 0 0 0 0 0 1 0] | |
[0 0 0 0 0 0 0 0 0 0] | |
[0 0 0 0 0 1 1 0 0 0] | |
[0 0 1 0 0 1 1 0 0 0] | |
[0 1 0 0 0 0 0 0 0 0] | |
[1 0 0 0 0 0 0 0 0 0]]) |
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
(require-macros :golly) | |
(local golly (require :golly)) | |
(defentity test-entity [self props] | |
{:x 300 :y 200 :width 200 :height 200} | |
(mixins (golly.mixins.mouse-interaction)) | |
(field :state | |
(statemachine :red | |
(transitions | |
(turn-red {:to :red}) |
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
;; Redux style state management | |
(local initial-state | |
{:screen nil | |
:energy 0 | |
:deck (icollect [_ ct (ipairs [:scout :warrior :healer :archer :scout :scout :scout])] | |
(make-card ct)) | |
:hand [] | |
:field [] | |
:discard []}) |