Skip to content

Instantly share code, notes, and snippets.

View georgiybykov's full-sized avatar
💥
...creating a code

Georgiy Bykov georgiybykov

💥
...creating a code
  • Saint-Petersburg
View GitHub Profile
Handlebars is a semantic web template system, started by Yehuda Katz in 2010.
Handlebars.js is a superset of Mustache, and can render Mustache templates in addition to Handlebars templates.
More: http://handlebarsjs.com/
1. Expressions.
1.1 Basic usage.
" vim-bootstrap
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "elixir,erlang,html,javascript,ruby"
let g:vim_bootstrap_editor = "nvim" " nvim or vim
@georgiybykov
georgiybykov / cors.json
Last active March 17, 2021 09:47
Simple cross-origin resource sharing (CORS) for AWS S3
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
@georgiybykov
georgiybykov / .rubocop.yml
Created March 2, 2021 13:43
Rubocop config file
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
TargetRubyVersion: 2.7.2
NewCops: enable
Exclude:
- bin/**/*
@georgiybykov
georgiybykov / heroku_pg_db_reset.md
Last active January 15, 2021 16:41
How to reset PostgreSQL database on Heroku?

How to reset PostgreSQL database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (do not change the DATABASE)
  • Step 3: heroku run rails db:migrate
  • Step 4: heroku run rails db:seed

Note

If you have more than one remote repository, then append in the end of each command --remote [name_of_the_remote] like this:

How to run examples:

  1. Run $ createdb nplusonedb to create DB
  2. Run specs $ rspec demo.rb
@georgiybykov
georgiybykov / alias_matchers.md
Created December 16, 2020 17:22 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@georgiybykov
georgiybykov / app.json
Last active November 15, 2020 23:36
Configurations for auto-deploy the Heroku Review Apps (includes `app.json` file)
# app.json
{
"name": "review-test-guru-app",
"description": "The application for creating and passing tests with ability to save questions to GitHub Gist.",
"repository": "https://github.com/georgiybykov/test-guru",
"scripts": {
"postdeploy": "pg_dump -Fc $DATABASE_URL | pg_restore --clean --no-owner -n public -d $DATABASE_URL && bundle exec rails db:migrate"
},
"env": {
@georgiybykov
georgiybykov / rubocop.yml
Last active March 2, 2021 15:23
GitHub actions config file to check project by RuboCop
# .github/workflows/rubocop.yml
name: RuboCop
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
@georgiybykov
georgiybykov / 1_brand.rb
Created October 11, 2020 23:04 — forked from KamilLelonek/1_brand.rb
Repository pattern example in Ruby for Rails developers
module Storage
module Models
class Brand < ActiveRecord::Base; end
end
end