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
# db/migrate/xxxxxxxxx_create_geocoder_data.rb | |
class CreateGeocoderData < ActiveRecord::Migration[6.0] | |
def change | |
create_table :geocoder_data, id: false do |t| | |
t.string :url, null: false, primary_key: true | |
t.jsonb :data | |
t.timestamps | |
end | |
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
def pagination_list | |
range = (0..maximum_pages_number).to_a | |
adjacent = (@pages_in_bar / 2).floor * 2 + 1 | |
range[[0, [range.size - 1 - adjacent, page_number.to_i - (adjacent / 2).ceil].min].max, adjacent] if adjacent >= 1 | |
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
version: 1 | |
frontend: | |
phases: | |
preBuild: | |
commands: | |
- npm ci | |
build: | |
commands: | |
- ENV=staging | |
- if [ "${AWS_BRANCH}" = "master" ]; then ENV=production; fi |
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
pipeline { | |
agent any | |
options { skipDefaultCheckout() } | |
environment { | |
AWS_DEFAULT_REGION = 'eu-west-1' | |
} | |
stages { | |
stage('Deploy') { | |
agent { |
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 bash | |
# It was a nightmare when! aftrer installing docker i couldn't expose any port | |
# so far because apparmor was preventing docker from controlling the network | |
# I spent days looking for the solution till I found this documentation <3 : | |
# https://wiki.debian.org/AppArmor/HowToUse | |
sudo mkdir -p /etc/default/grub.d | |
echo 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT apparmor=0"' \ | |
| sudo tee /etc/default/grub.d/apparmor.cfg | |
sudo update-grub |
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
FROM ruby:2.4.4-slim-jessie | |
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* | |
RUN wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | |
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/PostgreSQL.list | |
RUN apt-get update && \ | |
apt-get install -y build-essential libpq-dev git nodejs \ | |
file postgresql-client-10 locales imagemagick --no-install-recommends \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* |