I struggled to deploy sidekiq to an Ubuntu 20.04 server using the capistrano-sidekiq gem. Here are the steps I took to get it to work
Add to your Gemfile
gem 'sidekiq', '~> 6.2'Add to the development group of your gemfile
| # quickly commit your obsidian wiki to git | |
| cd ~/Google\ Drive/wiki | |
| git add . | |
| git commit -m "Update" | |
| exit |
| // jquery-cookies retired, moved this to js-cookie which no longer requires jQuery | |
| import Cookies from 'js-cookie' | |
| Cookies.set('tz', (new Date()).getTimezoneOffset()); |
I struggled to deploy sidekiq to an Ubuntu 20.04 server using the capistrano-sidekiq gem. Here are the steps I took to get it to work
Add to your Gemfile
gem 'sidekiq', '~> 6.2'Add to the development group of your gemfile
| class ChangeRawDiagnosesCreatedAtAndUpdatedAt < ActiveRecord::Migration[5.1] | |
| def change | |
| change_column_default :raw_diagnoses, :created_at, from: nil, to: -> { 'CURRENT_TIMESTAMP' } | |
| change_column_default :raw_diagnoses, :updated_at, from: nil, to: -> { 'CURRENT_TIMESTAMP' } | |
| end | |
| end |
I only use Citrix occasionally on my Mac. I did not like having it launch at startup. Here's how I stop it from starting at launch time. Derived from this helpful forum post
cd /Library/LaunchAgents
sudo rm com.citrix.*
cd /Library/LaunchDaemons
sudo rm com.citrix.ctx*Read more about getting this working here.
| # in general you should never need to use this in Rails | |
| # since you should use the url helpers | |
| # this is a really helpful post about how to do this elegantly with a concern | |
| # https://andycroll.com/ruby/url-helpers-outside-views-controllers/ | |
| def change_localhost_domain(url, new_domain) | |
| url.gsub(/http:\/\/localhost:3000|http:\/\/127.0.0.1:3000/, new_domain) | |
| end |
| # in order to support convention over configuration it can be useful to be able to find all the classes in a directory or | |
| # subdirectory. This lets you have easy factories for subclasses in Rails. | |
| # Requires that you are using Zeitwerk naming conventions for files and classes | |
| class YourRootClass | |
| # this does not work with rails because although the paths are autoloaded | |
| # the objects are not in memory (and are only in memory when instantiated) | |
| # and self.inherited is only called when the classes are put in memory | |
| # note: this likely happens in production but not in development | |
| # def self.inherited(klass) |
| import { Controller } from "@hotwired/stimulus" | |
| export default class extends Controller { | |
| submit() { | |
| event.currentTarget.form.requestSubmit() | |
| } | |
| } |
yarn add chartjs-plugin-annotationThen edit app/javascript/application.js
import "chartkick/chart.js"
# Add these lines