Skip to content

Instantly share code, notes, and snippets.

@ImMaax
ImMaax / pundit_helper.rb
Created November 14, 2023 11:11
Pundit Minitest Helper
# Insert into Rails' test_helper.rb or wherever else you place your test helpers
# Can be used like so:
# assert permits? :show?, User.new, Record.new
def permits?(action, user, record)
policy = "#{record.class.name}Policy".constantize.new user, record
policy.send action
end
@ImMaax
ImMaax / NextcloudCustom.css
Created July 20, 2020 18:45
My custom CSS for Nextcloud
#header:not(div) {
background: -moz-linear-gradient(top, #275983 0%, #1c3e5d 100%) !important;
background: -webkit-linear-gradient(top, #275983 0%,#1c3e5d 100%) !important;
background: linear-gradient(to bottom, #275983 0%,#1c3e5d 100%) !important;
}
.v-align #header { background: none }
.primary {
border-radius: 4px !important;