Skip to content

Instantly share code, notes, and snippets.

View olegnikitashin's full-sized avatar

Oleg Nikitashin olegnikitashin

  • Adjust
  • Berlin, Germany
View GitHub Profile
@olegnikitashin
olegnikitashin / rails_new_options_help.md
Created January 25, 2024 19:33 — forked from kirillshevch/rails_new_options_help.md
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 7+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
DROP TABLE IF exists `Sps.order`;
DROP TABLE IF exists `Sps.order_status`;
DROP TABLE IF exists `Sps.item_info`;
DROP TABLE IF exists `Sps.company_info`;
CREATE TABLE IF NOT EXISTS `Sps.order` (
id INT PRIMARY KEY,
number VARCHAR(255),
clientid INT,
date DATE,
@olegnikitashin
olegnikitashin / update-golang.md
Created January 26, 2020 17:04 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@olegnikitashin
olegnikitashin / format-xml-vi.md
Created January 17, 2020 16:39 — forked from jlacar/format-xml-vi.md
Format XML in vi using xmllint

Formatting XML in vi

Using xmllint

You can format XML in vi using xmllint

:%!xmllint "%" --format

Default indentation is 2 spaces. You can change that by assigning a value to the XMLLINT_INDENT environment variable. To do that without

[alias]
als = !sh -c 'git config --get-regexp alias | cut -c 7- | grep ^$1' -
a = add --all
ai = add -i
#############
ap = apply
as = apply --stat
ac = apply --check
#############
ama = am --abort
@olegnikitashin
olegnikitashin / HOWTO.md
Created May 5, 2019 17:48 — forked from krisleech/HOWTO.md
ActiveModel comforming Form object based on dry-type / dry-validation
require 'dry-validation'
require 'dry-struct'
require 'active_model/errors'

require_relative '../create_study'

module MyApp
  module Types
    include Dry::Types.module
@olegnikitashin
olegnikitashin / values_pointers.go
Created December 26, 2018 21:07 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@olegnikitashin
olegnikitashin / spec--capybara_helpers.rb
Created November 19, 2018 14:33 — forked from seanknox/spec--capybara_helpers.rb
RSpec + Capybara + Sauce Labs + Selenium (local or remote)
module CapybaraHelpers
class << self
def local_ip
ipv4_addr_info.ip_address
end
def setup_selenium_remote
app_host ||= ENV.fetch('SELENIUM_APP_HOST', local_ip)
Capybara.server_host = app_host
Capybara.app_host = "http://#{app_host}:#{Capybara.current_session.server.port}"