Skip to content

Instantly share code, notes, and snippets.

View Dimaon's full-sized avatar

Dmitriy Kulikov Dimaon

View GitHub Profile
@nachozt
nachozt / BootstrapToRails6.md
Last active November 8, 2022 23:26
Bootstrap to Rails 6 with webpacker

Step 1:

Add bootstrap and its dependencies:

yarn add bootstrap jquery popper.js

Step 2:

in config/webpack/environment.js add the following:

@EugZol
EugZol / deploy.sh
Last active April 15, 2020 18:04
Wall of text (to use in bash) to install Nginx (with Passenger), Ruby (with rb-env), Postgres, Postfix
VPS_DOMAIN="$(hostname --fqdn)" # changme: use your domain name
# Install DO agent
curl -sSL https://agent.digitalocean.com/install.sh | sh
# Update dist packages
apt-get update
apt-get dist-upgrade -y
# Install packages neccessary to compile stuff
@przbadu
przbadu / _vue-rails.md
Last active July 16, 2022 21:48
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.
@mankind
mankind / rails-jsonb-queries
Last active April 17, 2024 12:14
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@mkhuda
mkhuda / sidekiq.service
Last active June 28, 2022 23:15
Sidekiq service auto start for Ubuntu 16.04 using Systemd
#
# Sidekiq auto start using systemd unit file for Ubuntu 16.04
#
# Put this in /lib/systemd/system (Ubuntu).
# Run:
# 1. systemctl enable sidekiq (to enable sidekiq service)
# 2. systemctl {start,stop,restart} sidekiq (to start sidekiq service)
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).