This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puma::Plugin.create do | |
def production? | |
ENV.fetch('RACK_ENV', 'development') == 'production' | |
end | |
def log(msg) | |
if production? | |
Rails.logger.info msg | |
else | |
puts msg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name your class anything you want. Here, I call it Foo. | |
# Note that by writing out our code in its own class, we namespace it. | |
class Foo | |
constructor: -> | |
# Here we just set the host to your website, but you might want to add a little variable here | |
# to make it www.staging.yourwebsite.com when you're in the staging environment and localhost:3000 | |
# when you're in the development environment. | |
@host = "www.your-website.com" | |
# Makes the base of xml requests http when we are testing on localhost. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script data-version='v1' data-client-id='clients-id' id='unique-embedder-id' type='text/javascript'> | |
// "data-version": It's useful to put the version of your embedder script in the "version" data | |
// attribute. This will enable you to more easily debug if any issues arise. | |
// "data-client-id": This id allows us to pull up the correct client's settings from our database. | |
// Each client may have different settings associated with their widget, and you can load them | |
// with this! | |
// "id": This HTML id allows us to refer to this embedder script's location. This is helpful | |
// if you want to inject html code in specific places in hour hosts's website or if you want to | |
// insert your payload script right next to this in the <head> tag. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |