Skip to content

Instantly share code, notes, and snippets.

View alexxty7's full-sized avatar

Alexandr Katulskiy alexxty7

View GitHub Profile
Redis.current = Redis.new(:host => ENV["REDIS_HOST"], :port => ENV["REDIS_PORT"])
bundle exec rake active_record_doctor:unindexed_foreign_keys

notifications job_id
bundle exec rake active_record_doctor:extraneous_indexes

The following indexes are extraneous and can be removed:
@alexxty7
alexxty7 / README.md
Created March 23, 2019 18:38 — forked from galkin/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


gem install rails --prerelease && rails new *** -d postgresql --skip-action-mailbox --skip-action-text --skip-action-cable --skip-sprockets --skip-spring --skip-test --skip-bundle
# Macro::Queue(Api::V1::Clients::Bookings::Operation::CreateChat, args: [:booking])
module Macro
def self.Queue(constant, args:)
task = lambda { |(ctx, flow_options), **|
StepWorker.perform_async(constant, ctx.slice(*args))
[Trailblazer::Activity::Left, [ctx, flow_options]]
}
@alexxty7
alexxty7 / signal_catching.rb
Created July 4, 2019 19:51 — forked from sauloperez/signal_catching.rb
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {
@alexxty7
alexxty7 / gist:b80fc168af8f5bfe21732b92eaefd9c9
Created July 1, 2021 07:34
useDevices handler (from twilio demo)
export default function useDevices() {
const [deviceInfo, setDeviceInfo] = useState({
audioInputDevices: [],
videoInputDevices: [],
audioOutputDevices: [],
hasAudioInputDevices: false,
hasVideoInputDevices: false,
});
useEffect(() => {