Skip to content

Instantly share code, notes, and snippets.

View zinovyev's full-sized avatar

Zinovyev Ivan zinovyev

View GitHub Profile
@maxivak
maxivak / webpacker_rails.md
Last active April 13, 2023 18:46
Webpack, Yarn, Npm in Rails
@MauricioMoraes
MauricioMoraes / access_postgresql_with_docker.md
Last active November 2, 2023 23:34
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@siklodi-mariusz
siklodi-mariusz / Dockerfile
Created January 30, 2018 19:40
Dockerfile example for Ruby on Rails running on Alpine Linux
FROM ruby:2.4-alpine3.7
# Install dependencies:
# - build-base: To ensure certain gems can be compiled
# - nodejs: Compile assets
# - postgresql-dev postgresql-client: Communicate with postgres through the postgres gem
# - libxslt-dev libxml2-dev: Nokogiri native dependencies
# - imagemagick: for image processing
RUN apk --update add build-base nodejs tzdata postgresql-dev postgresql-client libxslt-dev libxml2-dev imagemagick
@Vetal4eg
Vetal4eg / devise.ru.yml
Created June 18, 2017 10:12
Russian I18n locale for devise.
# Русский перевод для https://github.com/plataformatec/devise/tree/v4.3.0
# Другие переводы на http://github.com/plataformatec/devise/wiki/I18n
ru:
devise:
confirmations:
confirmed: "Ваша учётная запись подтверждена."
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: "Если ваш электронный адрес есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
failure:
@varyonic
varyonic / docker-compose.yml
Last active May 18, 2021 13:18
Capybara standalone Selenium Chrome config
web:
build: .
volumes:
- .:/opt/myapp
ports:
- '3000:3000'
links:
- db
- redis
- selenium
@moschlar
moschlar / git-daemon
Created August 4, 2015 06:19
systemd-unit for git-daemon
# conf.d file for git-daemon
#
# Please check man 1 git-daemon for more information about the options
# git-daemon accepts. You MUST edit this to include your repositories you wish
# to serve.
#
# Some of the meaningful options are:
# --syslog --- Enables syslog logging
# --verbose --- Enables verbose logging
# --export-all --- Exports all repositories
@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active March 3, 2024 20:10
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@maxivak
maxivak / readme.md
Last active March 25, 2023 01:56
sitemap.xml for Rails 4 application

Generate sitemap.xml in Rails app

This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml

Routes

Myrails::Application.routes.draw do
@kugaevsky
kugaevsky / datetime.ru.yml
Created September 3, 2014 14:17
Datetime Russian i18n for Ruby on Rails
ru:
date:
formats:
# Форматы указываются в виде, поддерживаемом strftime.
# По умолчанию используется default.
# Можно добавлять собственные форматы
#
#
# Use the strftime parameters for formats.
# When no format has been given, it uses default.