First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
// https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce | |
Date.prototype.toDatetimeLocal = | |
function toDatetimeLocal() { | |
var | |
date = this, | |
ten = function (i) { | |
return (i < 10 ? '0' : '') + i; | |
}, | |
YYYY = date.getFullYear(), | |
MM = ten(date.getMonth() + 1), |
//....add this in app/assets/javascript/active_admin.js | |
$(function(){ | |
// CONFIGURE PANELS COLLAPSER | |
$(".panel[data-panel]").each(function(){ | |
var $this = $(this); | |
var $a = $("<a href='javascript:void(null)'>").on("click",function(event){ | |
$(this).closest(".panel").find(".panel_contents").each(function(){ | |
$(this).slideToggle(); | |
}); | |
$(this).closest("h3").each(function(){ |
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
# frozen_string_literal: true | |
namespace :cleanup do | |
JUMPSTART_TASK = 'cleanup:jumpstart' | |
ANNOTATE_TASK = 'cleanup:annotate' | |
ANNOTATE_ROUTES_TASK = 'cleanup:annotate_routes' | |
RUBOCOP_TASK = 'cleanup:rubocop' | |
ALL_CLEANUP = [JUMPSTART_TASK, | |
ANNOTATE_TASK, | |
ANNOTATE_ROUTES_TASK, |
#!/bin/env ruby | |
# lazy hack from Robert Klemme | |
module Memory | |
# sizes are guessed, I was too lazy to look | |
# them up and then they are also platform | |
# dependent | |
REF_SIZE = 4 # ? | |
OBJ_OVERHEAD = 4 # ? |
# frozen_string_literal: true | |
module Speed | |
PAGE_UPDATES = 'SPcstat:all_updates' | |
VERSION_NAME = "mv|#{Rails.env}" | |
# the master version increments the 'decimal' portion | |
# each day (using julian day) | |
# this automatically invalidates the cache at least once daily |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
(function( $ ){ | |
$.fn.dependsOn = function(element, value) { | |
var elements = this; | |
var hideOrShow = function() { | |
var $this = $(this); | |
var showEm; | |
if ( $this.is('input[type="checkbox"]') ) { | |
showEm = $this.is(':checked'); | |
} else if ($this.is('select')) { |