Skip to content

Instantly share code, notes, and snippets.

View 7vs's full-sized avatar
🐚
Dreaming

Silvio Vaz 7vs

🐚
Dreaming
  • 7vs
  • London
View GitHub Profile

Shopify Upgrow

Ruby on Rails is the framework of choice for web apps at Shopify. It is an opinionated stack for quick and easy development of apps that need standard persistence with relational databases, an HTTP server, and HTML views.

By design, Rails does not define conventions for structuring business logic and domain-specific code, leaving developers to define their own architecture and best practices for a sustainable codebase.

In fast product development teams, budgets and deadlines interfere with this architectural work, leading to poorly written business logic and complicated code that is very hard to maintain long term. Even when developer teams take the time to think about what a good architecture in Rails look like, this work is likely required to be done all over again when a new Rails app needs to be created.

This project aims to make it easier for both new and existing Rails apps to adopt patterns that are proven to make code more sustainable long term, and codebases easier to maintain an

@7vs
7vs / nginx.conf.default
Created December 18, 2020 09:40 — forked from nishantmodak/nginx.conf.default
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@7vs
7vs / ruby_readline_issue.md
Created February 14, 2019 11:16 — forked from soultech67/ruby_readline_issue.md
ruby bundler: Sorry, you can't use byebug without Readline

Preamble

On OS/X Sierra, after recently running a brew update I started receiving the error message Sorry, you can't use byebug without Readline when trying to run some rake tasks in my ruby project folder. I observed this in projects and gems that include byebug or pry in their Gemfile or gem.spec. I've found in my googling that many begin encountering this error message after running a brew update but there are other triggering conditions as well.

>> rake aws:show_config
WARN: Unresolved specs during Gem::Specification.reset:
      mime-types (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
 Sorry, you can't use byebug without Readline. To solve this, you need to
@7vs
7vs / nodereinstall.sh
Created August 31, 2018 17:33 — forked from brock/nodereinstall.sh
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"
@7vs
7vs / attribute_spec_helper.rb
Created May 28, 2018 11:34 — forked from PareshGupta/attribute_spec_helper.rb
Rspec matcher for attr_accessor, attr_reader and attr_writer
# `have_attr_reader` matcher for attr_reader
RSpec::Matchers.define :have_attr_reader do |field|
match do |object_instance|
object_instance.respond_to?(field)
end
failure_message do |object_instance|
"expected attr_reader for #{ field } on #{ object_instance }"
end
@7vs
7vs / Capybara.md
Created January 22, 2018 12:36 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@7vs
7vs / heroku_pipelines.md
Created November 6, 2017 16:54 — forked from tiagopog/heroku_pipelines.md
Heroku Pipelines CLI

Pipelines

Many Pipelines operations can be performed via the CLI, which requires the Pipelines plugin for the Heroku Toolbelt. To install:

% heroku plugins:install heroku-pipelines
% heroku help pipelines
% heroku apps:create une-pipe-staging
@7vs
7vs / gist:0e42df44d2a288174896de96322dd4f7
Created November 5, 2017 20:59 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install [email protected]
brew unlink [email protected]
brew link postgresql
@7vs
7vs / cors.xml
Created July 19, 2017 10:11
Deploy Locomotive CMS instance to heroku guide
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>https://yourdomainname.herokuapp.com</AllowedOrigin>
<AllowedOrigin>http://yourdomainname.herokuapp.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>