Skip to content

Instantly share code, notes, and snippets.

<% @name = "Integration logs for #{@integrator.integration[:name]}" %>
<% @tab = :admin %>
<div class='container container--medium'>
<div class='toolbar'>
<%= render "breadcrumbs", include_self: true %>
</div>
@andhart
andhart / passwords_controller.rb
Last active September 6, 2022 16:56
I have an SQL query defined below which is a regex looking for a domain. This works great, however, I'm trying to get where it says stripe.co to reflect the value of the variable domain.
class PasswordsController < Test::BaseController
def index
records = AssetPassword.all
domain = "google.com"
records = records
.where("url ~ 'stripe.co([\/?]|$)'")
REQUIREMENTS:
- Query must be done using SQL (preferably utilizing ActiveRecord, but can also be raw SQL queries)
JOB DESCRIPTION:
We have a few RAILS models:
# company.rb (app/models)
## Version 2019/08/01 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/default
# redirect all traffic to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
#!/bin/sh
set -eu
# Docker
sudo apt remove --yes docker docker-engine docker.io \
&& sudo apt update \
&& sudo apt --yes --no-install-recommends install \
apt-transport-https \
ca-certificates \
module Recordingable
extend ActiveSupport::Concern
included do
has_many :recordings, as: :recordingable
after_commit :record_item
end