Skip to content

Instantly share code, notes, and snippets.

View bestwebua's full-sized avatar
:octocat:

Vladislav Trotsenko bestwebua

:octocat:
View GitHub Profile
@bestwebua
bestwebua / scraping_kata.rb
Last active April 6, 2018 13:22
Scraping kata
require 'nokogiri'
require 'open-uri'
class User
attr_reader :name, :clan, :honor
def initialize(name, clan, honor)
@name, @clan, @honor = name, clan, honor
end
@bestwebua
bestwebua / active_admin.rb
Created September 2, 2018 12:49 — forked from llxff/active_admin.rb
Using devise + activeadmin with one User model and separate sign_in entry points
config.authentication_method = :authenticate_admin_user!
config.current_user_method = :current_admin_user
config.logout_link_path = :destroy_user_session_path
@bestwebua
bestwebua / howto.bash
Last active April 28, 2019 18:00
Rails + PostgreSQL
sudo apt-get install postgresql libpq-dev cmake
sudo -u postgres createuser --interactive
sudo -u postgres createdb [your_rails_project]_development
sudo -u postgres createdb [your_rails_project]_test
sudo service postgresql restart
ps -ax | grep postg
rails s
{
"subscription": {
"title": "Some Title",
"start_date": "2020-06-05T14:32:57Z",
"end_date": "2020-06-05T14:32:57Z",
"quantity": 1,
"type": "some type",
"unit_price": "42.42",
"amount": "42.42"
},
@bestwebua
bestwebua / upgrade26.md
Created November 30, 2020 10:54 — forked from tgaff/upgrade26.md
ruby 2.3 to 2.6 upgrade

local

brew upgrade ruby-install
ruby-install ruby 2.6.5

install bundler 2.1.4 (may not be necessary)

Depending on ruby version manager (rvm/chruby/rbenv) you may need to change directories or select ruby 2.6.5 then