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
| // http://codecombat.com/play/level/hunting-party | |
| // Strategy: move all troops continuously to the right, | |
| // making sure to keep the archers behind the frontline | |
| // so that the soldiers take the enemy attacks. Player | |
| // character follows along the front line and heals | |
| // any soldier/archer that is below max health. | |
| var front = [ 30, 30, 30 ]; // Frontline for Groups |
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
| $("table.form-table td:contains('Google Profile Avatars')").hide(); |
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
| // http://codecombat.com/play/level/binary-search | |
| // Guess the number that the paladin is thinking of each round. | |
| // She will indicate whether the answer is a higher or lower number after each guess. | |
| // She moves to x<39.5 if lower and x>40.5 if higher | |
| // and x==40 if correct. | |
| // The paladin's maxNum property is the upper bound of the number. | |
| var paladin = this.findNearest(this.findFriends()); |
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
| // track positions for safe route back to center | |
| var positionStack = []; | |
| // track last target, to determine changes | |
| var lastTarget = { x: 40, y: 34 }; | |
| loop { | |
| var gem = this.findNearest(this.findItems()); | |
| if (gem) { |
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
| // Returns Best Coin to Move Toward | |
| this.bestCoin = function() { | |
| var bestCoin = null; | |
| var coinRank = 0; | |
| var coins = this.findItems(); | |
| for (var i=0; i < coins.length; i++) { | |
| if ( coins[i].value / this.distanceTo(coins[i]) > coinRank ) { | |
| coinRank = coins[i].value / this.distanceTo(coins[i]); | |
| bestCoin = coins[i]; |
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
| // Use isPathClear to move around the randomly positioned boulders. | |
| // Automatic pathfinding doesn't work in Boulder Woods. | |
| loop { | |
| var angle = Math.PI / 2 - Math.PI / 16; | |
| while (angle >= -Math.PI / 2) { | |
| var targetX = this.pos.x + 5 * Math.cos(angle); | |
| var targetY = this.pos.y + 5 * Math.sin(angle); | |
| // Use isPathClear between your current pos and the target. | |
| targetPos = { x: targetX, y: targetY }; |
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
| // Stay alive for one minute. | |
| // If you win, it gets harder (and more rewarding). | |
| // If you lose, you must wait a day before you can resubmit. | |
| // Remember, each submission gets a new random seed. | |
| // Determines if Warrior should use cleave | |
| // When? | |
| // - If cleave is ready AND | |
| // - If there are more than 2 enemies within cleave range | |
| this.shouldCleave = function() { |
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
| // functions.php | |
| add_theme_support( 'post-formats', array( 'link' ) ); |
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
| $ heroku config:set S3_ACCESS_KEY=<access key> | |
| $ heroku config:set S3_SECRET_KEY=<secret key> | |
| $ heroku config:set S3_BUCKET=<bucket name> | |
| $ heroku config:set S3_REGION=<bucket region> |
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
| # config/initializers/carrier_wave.rb | |
| if Rails.env.production? | |
| CarrierWave.configure do |config| | |
| config.fog_credentials = { | |
| # Configuration for Amazon S3 | |
| :provider => 'AWS', | |
| :aws_access_key_id => ENV['S3_ACCESS_KEY'], | |
| :aws_secret_access_key => ENV['S3_SECRET_KEY'], | |
| :region => ENV['S3_REGION'] |