Skip to content

Instantly share code, notes, and snippets.

View beckyconning's full-sized avatar

Becky Conning beckyconning

View GitHub Profile
var container, stats;
var camera, scene, renderer;
var projector, plane;
var mouse2D, mouse3D, ray, theta = 45,
isShiftDown = false, isCtrlDown = false,
target = new THREE.Vector3( 0, 200, 0 );
var ROLLOVERED;
Crafty.c("Metronome", {
_bpm: 85,
_resolution: 64,
_beatsPerBar: 4,
_period: function() {
var beatPeriod = (60000 / this._bpm) / (this._resolution / this._beatsPerBar);
return beatPeriod;
},
_startTime: 0,
_timeNow: 0,
// Domain Specific Language:
ActualBrowserWorld.prototype.startObjectEditor = function (callback) {
var self = this;
self.browser
.chain
.session()
.open('http://localhost/~becky/island/tools/object-editor/index.html')
.assertTitle("*Object Editor")
.end(function(err){
self.browser.testComplete(function() {
As a video game developer
I want to develop a video game without being hungry
So that I will be happy and more productive
Scenario: Work on a video game without any doughnuts
Given I do not have any doughnuts
When I try to program or create other assets for a video game
Then I should be hungry
Scenario: Will's birthday
javascript:goToURLWithoutFirstOfClass=function(url,className){var iframeElement=fullWindowIframeWithURL(url);coverUpElement=document.body.appendChild(documentSizeForegroundWhiteDiv());iframeElement.onload=function(e){removeFirstOfClassFromPage(url,className);iframeElement.contentDocument.body.style.backgroundColor="#ffffff";coverUpElement.parentNode.removeChild(coverUpElement);};document.body.appendChild(iframeElement);};fullWindowIframeWithURL=function(url){iframeElement=document.createElement("IFRAME");iframeElement.setAttribute('src',url);iframeElement.style.width='100%';iframeElement.style.height='100%';iframeElement.style.position='absolute';iframeElement.style.top=0;iframeElement.style.left=0;iframeElement.style.zIndex='9999';return iframeElement;};documentSizeForegroundWhiteDiv=function(){var divElement=document.createElement('div');divElement.style.width='100%';divElement.style.height='100%';divElement.style.position='absolute';divElement.style.backgroundColor="#ffffff";divElement.style.top=0;divEleme
goToURLWithoutFirstOfClass=function(a,b){var c=fullWindowIframeWithURL(a);coverUpElement=document.body.appendChild(documentSizeForegroundWhiteDiv());c.onload=function(d){removeFirstOfClassFromPage(a,b);c.contentDocument.body.style.backgroundColor="#ffffff";coverUpElement.parentNode.removeChild(coverUpElement)};document.body.appendChild(c)};fullWindowIframeWithURL=function(a){iframeElement=document.createElement("IFRAME");iframeElement.setAttribute("src",a);iframeElement.style.width="100%";iframeElement.style.height="100%";iframeElement.style.position="absolute";iframeElement.style.top=0;iframeElement.style.left=0;iframeElement.style.zIndex="9999";return iframeElement};documentSizeForegroundWhiteDiv=function(){var a=document.createElement("div");a.style.width="100%";a.style.height="100%";a.style.position="absolute";a.style.backgroundColor="#ffffff";a.style.top=0;a.style.left=0;a.style.zIndex=99999;return a};removeCoverUpElement=function(){coverUpElement.parentNode.removeChild(coverUpElement)};removeFirstOfClas
board_size, snake_length, snake_positions, snake_vector, fruit_position = 15, 3, [[5,6],[5,5],[5,4]], [1,0], [rand(15), rand(15)] # set game board size, snake starting position, snake starting direction and fruit position
system "stty -icanon -echoke" # set console to non-canonical mode so it doesn't require end of line to get input
loop do # loop infinitely
if ( input = select([$stdin], nil, nil, 0.2) ) then if ( STDIN.getc.chr == "\e" ) then if ( STDIN.getc == ?[) then input = STDIN.getc end end end # get input
if ( input == ?A ) then snake_vector = [0,-1] elsif ( input == ?B ) then snake_vector = [0,1] elsif ( input == ?C ) then snake_vector = [1,0] elsif ( input == ?D ) then snake_vector = [-1,0] end # set snake movement direction based on input
if ( snake_positions.last == fruit_position ) then snake_length, fruit_position = snake_length + 1, [rand(board_size), rand(board_size)] elsif ( snake_positions.index(fruit_position) ) then fruit_position = [rand(board_size), rand(board_size)] elsif ( ( snak
describe("Infographic", function() {
var infographic;
beforeEach(function() {
loadFixtures('table.html');
infographic = Infographic();
$table = $('table');
});
describe("updateFromTable($table)", function() {
expect(raphaelPaper.circle()).toHaveBeenCalledWith(
expectedCenter, expectedCenter, (expectedDiameter / 2)
);
format.csv {
send_data(
render_to_string,
:type => "text/csv",
:filename => "review.csv",
:dispostion => 'attachment',
:status => '200 OK'
)
}