Skip to content

Instantly share code, notes, and snippets.

View bhavik2936's full-sized avatar
🙂

Bhavik Parmar bhavik2936

🙂
View GitHub Profile
@bhavik2936
bhavik2936 / cleanup.rake
Created May 13, 2024 14:24
Demonstration of rake task for resetting the password_changed_at attribute with a random timestamp ranging from 60 to 90 days ago
namespace :cleanup do
desc 'Update users\' password_changed_at timestamp between 60 and 90 days old'
# Execute the rake task as cleanup:update_user_password_changed_at_timestamp
task update_user_password_changed_at_timestamp: :environment do
logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
Client.each_tenant do |client|
logger.info "Queueing UpdateUserPasswordChangedAtTimestampJob for #{client.subdomain}"
UpdateUserPasswordChangedAtTimestampJob.perform_async(client.subdomain)
@bhavik2936
bhavik2936 / README.md
Last active June 2, 2021 11:49
ReadMe file for redcarpet implementation repository

Redcarpet Gem Example

Demonstrates the use of redcarpet gem for markdown support in text with the help of coderay gem for syntax highlighting.

Description

The project have been implemented to demonstrate how we can use redcarpet gem to make pages supporting markdown in ruby on rails framework.

Install

To setup project locally, follow below instructions.

Project Configuration

@bhavik2936
bhavik2936 / production.rb
Created December 16, 2020 09:11
production.rb which results an empty manifest.json file on heroku
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.