Prerequisites:
- Heroku CLI installed on your computer
- A project deployed to Heroku
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. | |
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
module ActiveRecord | |
class QueryLocator | |
def call(name, started, finished, unique_id, payload) | |
# filter caller locations to application backtrace (filter all gem calls) | |
# see http://ruby-doc.org/core-2.5.0/Kernel.html#method-i-caller_locations for more options | |
caller_names = caller_locations.select { |line| line.to_s =~ /#{Rails.root.to_s}/ } | |
# use the last caller in backtrace | |
caller_name = caller_names.first | |
Rails.logger.debug ["Notification:", name, started, finished, unique_id, caller_name, payload].join(" - ") |
Prerequisites:
# FOR BUSY JOBS | |
# take the process_id from the /busy page in sidekiq and kill the longest running one. | |
workers = Sidekiq::Workers.new | |
long_process_id = 'integration.3:4:71111aaa111' # Eg: 'integration.3:4:71d1d7f4ef5a' | |
workers.each do |process_id, thread_id, work| | |
process = Sidekiq::Process.new('identity' => process_id) | |
process.stop! if process_id == long_process_id | |
end | |
# FOR SCHEDULED JOBS |
# Why: | |
# 1) Chrome 63 (Dec 8) breaks .dev domains by forcing HTTPS: https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/ | |
# 2) Pow is at EOL, superceded by puma-dev (see http://pow.cx/manual, 6 Version History, 0.6.0, Dec 8 2017) | |
# Uninstall pow | |
curl get.pow.cx/uninstall.sh | sh | |
# If you use powder, you can remove it as well | |
gem uninstall powder |
OldHttpRequest = Turbolinks.HttpRequest | |
class Turbolinks.CachedHttpRequest extends Turbolinks.HttpRequest | |
constructor: (_, location, referrer) -> | |
super(this, location, referrer) | |
requestCompletedWithResponse: (response, redirectedToLocation) -> | |
@response = response | |
@redirect = redirectedToLocation |
# app/admin/email_previews.rb | |
ActiveAdmin.register_page 'Email Previews' do | |
menu parent: 'dashboard', priority: 10 | |
content do | |
div '1' | |
end | |
sidebar 'Mail Previews' do | |
Dir['test/mailers/previews/**/*_preview.rb'].each do |preview_path| |
# GPG on Tower |
# Commonmarker's default html renderer: https://github.com/gjtorikian/commonmarker/blob/master/lib/commonmarker/renderer/html_renderer.rb | |
# It has a sepparate method for each type of html tag it supports | |
# paragraph method: | |
def paragraph(node) | |
if @in_tight && node.parent.type != :blockquote | |
out(:children) | |
else | |
block do |