Skip to content

Instantly share code, notes, and snippets.

View stereosupersonic's full-sized avatar

MICE Portal stereosupersonic

View GitHub Profile
@stereosupersonic
stereosupersonic / .rubocop_rspec.yml
Created April 20, 2020 10:57 — forked from palkan/.rubocop_rspec.yml
rubocop-rspec config
require:
- rubocop-rspec
RSpec/Focus:
Enabled: true
RSpec/EmptyExampleGroup:
Enabled: true
RSpec/EmptyLineAfterExampleGroup:
@stereosupersonic
stereosupersonic / .rubocop_rails.yml
Created April 20, 2020 10:55 — forked from palkan/.rubocop_rails.yml
rubocop-rails config
# Based on removed standard configuration:
# https://github.com/testdouble/standard/commit/94d133f477a5694084ac974d5ee01e8a66ce777e#diff-65478e10d5b2ef41c7293a110c0e6b7c
require:
- rubocop-rails
Rails/ActionFilter:
Enabled: true
EnforcedStyle: action
Include:
@stereosupersonic
stereosupersonic / .rubocop_strict.yml
Created April 20, 2020 10:52 — forked from palkan/.rubocop_strict.yml
rubocop-strict config
# Inherit from TODO here to make sure we enforce the rules below
# (and TODO is ignored)
inherit_from:
- .rubocop_todo.yml
Lint/Debugger: # don't leave binding.pry
Enabled: true
Exclude: []
RSpec/Focus: # run ALL tests on CI
@stereosupersonic
stereosupersonic / application_helper.rb
Created April 17, 2020 12:12
rails bootstrap buttons
module ApplicationHelper
# date/time
def format_time(time)
time&.strftime "%H:%M"
end
def format_date(date)
date&.strftime "%d.%m.%Y"
end
@stereosupersonic
stereosupersonic / linux_setup.md
Last active March 30, 2021 09:21
my linux (debian) setup
@stereosupersonic
stereosupersonic / postgres_queries_and_commands.sql
Created January 9, 2019 14:50 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@stereosupersonic
stereosupersonic / Capybara.md
Created February 28, 2018 14:47 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@stereosupersonic
stereosupersonic / README-Template.md
Created November 3, 2017 07:37 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

begin
result = some_method
rescue MyApp::Exception => e
retries ||= 0
retries += 1
raise e if retries > 5
retry
end