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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
html, body { | |
margin:0px; | |
padding:0px; | |
width: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
Q.compileSheets("sprites.png","sprites.json"); | |
Q.animations('player', { | |
run_right: { frames: [0,1,2,3,4,5], rate: 1/8}, | |
run_left: { frames: [9,10,11,12,13,14], rate: 1/8}, | |
stand_right: { frames: [2], rate: 1/5}, | |
stand_left: { frames: [11], rate: 1/5}, | |
jump_right: { frames: [6,7,8], rate: 1/5, loop: false }, | |
jump_left: { frames: [15,16,17], rate: 1/5, loop: false}, | |
fly_right: { frames: [8], rate: 1/5, loop: false }, | |
fly_left: { frames: [17], rate: 1/5, loop: false} |
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
Q.gravityY = 0; | |
Q.Sprite.extend("Player",{ | |
init: function(p) { | |
this._super(p, { sheet: "player", x: 410, y: 90 }); | |
this.add('2d'); | |
this.on("hit.sprite",function(collision) { | |
if(collision.obj.isA("Tower")) { |
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
#!/usr/bin/env ruby1.8 | |
require 'rubygems' | |
require 'nokogiri' | |
# Copyright @2011 Pascal Rettig - Released under the MIT License, | |
# No Warranty whatsoever. This will probably destroy your project | |
# | |
# Find out who the goat is on your Rails the project - i.e the person responsible for | |
# writing or modifying the most untested code. Drop goat.rb into your script/ | |
# directory, make it executable then run: |
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
$ ab -n 4000 -c 100 http://localhost:1337/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 400 requests | |
Completed 800 requests | |
Completed 1200 requests | |
Completed 1600 requests |