Skip to content

Instantly share code, notes, and snippets.

resources :media, shallow: true,
constraints: ->(req) do
current_user = req.env["warden"].user(:user)
Flipper.enabled?(:media_uploads, current_user)
end
@el-feo
el-feo / code_review_pyramid.svg
Created May 6, 2022 16:00
Code Review Pyramid
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@el-feo
el-feo / gist:54c8b72e2e8a759f3f33744983764a09
Created July 7, 2020 00:59 — forked from bbonamin/gist:96be60bad7fa5164a092
SSL in Development with Nginx + Rails
  1. Install nginx brew install nginx
  2. Cd into the nginx directory /usr/local/etc/nginx
  3. Create a ssl directory, change and generate a dummy ssl cert: mkdir ssl cd ssl penssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -keyout server.key -out server.crt (just accept the default empty settings)
  4. Go back to the nginx directory cd ..
  5. Create or edit nginx.conf with the following settings:
events {
@el-feo
el-feo / database.yml
Created June 20, 2017 17:58 — forked from spalladino/database.yml
Rake task to copy master development database into current database branch
<%
require 'config'
branch = `git rev-parse --abbrev-ref HEAD`.strip rescue nil
use_single_db = !Settings.db_per_branch || !branch || branch == 'master'
branch_spec = (use_single_db ? "" : "_#{branch}").underscore.gsub(/[\.\/\-]/, '_')
%>
development:
<<: *default
database: app_development<%= branch_spec %>
@el-feo
el-feo / gist:a73f526efd8007d28043cb09e836944d
Last active March 27, 2022 14:14 — forked from nuxlli/console.rb
To access url helpers (url_for, etc) from Rails console (Rails 3)
We couldn’t find that file to show.