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
class AddVirtualColumnIndexToAhoyEvents < ActiveRecord::Migration[6.0] | |
def up | |
ActiveRecord::Base.connection.execute ( | |
'ALTER TABLE ahoy_events ADD properties_id INT AS (JSON_UNQUOTE(properties->"$.id")) STORED;' | |
) | |
ActiveRecord::Base.connection.execute ( | |
'ALTER TABLE ahoy_events ADD INDEX (properties_id);' | |
) | |
end | |
def down |
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
# https://brandonhilkert.com/blog/reducing-sidekiq-memory-usage-with-jemalloc/ | |
files: | |
"/etc/environment": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
LD_PRELOAD=/usr/lib64/libjemalloc.so |
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
## for Aamazon Linux 2 | |
commands: | |
01-install-libs: | |
command: yum install -y libwebp-devel libjpeg-turbo-devel ImageMagick-devel | |
02-setup-epel-repo: | |
command: | | |
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
if [ $? -ne 1 ]; then # Exit on any any error except 'nothing to do' | |
exit 0 |
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
# Example of nginx configulation file for AL2 Amazon Elastic Beanstalk | |
# your vpc subnet where ELB resides in | |
set_real_ip_from 10.0.0.0/8; | |
# Then you have the configuration like this. Please note real_ip_header and real_ip_recursive have | |
# to be placed in the bottom of the IP list otherwise the module will not work properly(I’ve spent so much time on this). | |
real_ip_header X-Forwarded-For; |
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
#!/bin/sh | |
cd /var/app/current/ | |
sudo /opt/elasticbeanstalk/.rbenv/shims/bundle exec whenever --update-crontab |
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
#!/bin/sh | |
# default bundler of Amazon Linux 3.1.1 is 2.1.4, so no need to update | |
sudo /opt/elasticbeanstalk/.rbenv/shims/gem install bundler -v 2.1.4 |
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
#!/bin/sh | |
# need to install node first to be able to install yarn | |
sudo curl --silent --location https://rpm.nodesource.com/setup_14.x | sudo bash - | |
sudo yum -y install nodejs | |
# install yarn | |
sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo | |
sudo yum -y install yarn |
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
# Puma can serve each request in a thread from an internal thread pool. | |
# The `threads` method setting takes two numbers: a minimum and maximum. | |
# Any libraries that use thread pools should be configured to match | |
# the maximum value specified for Puma. Default is set to 5 threads for minimum | |
# and maximum; this matches the default thread size of Active Record. | |
# | |
# Specifies the `environment` that Puma will run in. | |
rails_env = ENV['RACK_ENV'] || "development" |
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
web: bundle exec puma -C /var/app/current/config/puma.rb |
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
<%# app/views/layouts/application.html.erb %> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- add this new application.js --> | |
<%= javascript_pack_tag 'application' %> | |
</head> | |
<body> | |
<%= yield %> | |
</body> |
NewerOlder