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
.ebextensions/01_postgres_packages.config # Packages needed to install the `pg` postgres gem. | |
config/eb_deployer.yml # It configures eb_deployer options as well as Elastic Beanstalk. | |
config/rds.json # The CloudFormation stack configuration with a Postgres RDS instance. | |
lib/tasks/eb_deployer.rake # Deployment tasks for you to customize. |
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
application: example_app | |
common: | |
solution_stack_name: 64bit Amazon Linux 2015.03 v1.3.1 running Ruby 2.1 (Passenger Standalone) | |
smoke_test: | | |
curl_http_code = "curl -s -o /dev/null -w \"%{http_code}\" http://#{host_name}" | |
Timeout.timeout(600) do | |
until ['200', '301', '302'].include?(`#{curl_http_code}`.strip) | |
sleep 5 |
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
namespace :eb do | |
def eb_deployer_env | |
ENV["EB_DEPLOYER_ENV"] || "dev" | |
end | |
def eb_deployer_package | |
git_sha = `git log -n1 | awk '/^commit/ {print $2; exit;}' | cut -c 1-10`.strip | |
"tmp/pkg/example_app-#{git_sha}-#{ENV['VERSION_LABEL_SUFFIX']}.zip" | |
end |
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
production: | |
adapter: postgresql | |
database: <%= ENV['DATABASE_NAME'] || 'example_app' %> | |
host: <%= ENV['DATABASE_HOST'] || 'localhost' %> | |
port: <%= ENV['DATABASE_PORT'] || 5432 %> | |
username: <%= ENV['DATABASE_USERNAME'] || 'my_user' %> | |
password: <%= ENV['DATABASE_PASSWORD'] %> | |
min_messages: ERROR |
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
gem 'eb_deployer' |
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
all_characters = [('a'..'z'), ('A'..'Z'), (0..9)].map { |i| i.to_a }.flatten | |
secret = (0...100).map { all_characters[rand(all_characters.length)] }.join | |
puts secret |
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
var aVera = true; | |
var Robot = function(robot) {}; | |
var RobotState = function (rotateStep) { | |
data = {}; | |
data.id = 0; | |
data.isLookingAtTarget = false; | |
data.timesShooting = 0; | |
data.rotateStep = rotateStep; |
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
var aVera = true; | |
var Robot = function(robot) {}; | |
var RobotState = function (rotateStep) { | |
data = {}; | |
data.id = 0; | |
data.isLookingAtTarget = false; | |
data.timesShooting = 0; | |
data.rotateStep = rotateStep; |
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
require 'net/http' | |
module LinkOpener | |
def content_from_link(link) | |
uri = URI.parse(link) | |
http = Net::HTTP.new(uri.host, uri.port) | |
if link =~ /https:/ | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
NewerOlder