Skip to content

Instantly share code, notes, and snippets.

View alexxty7's full-sized avatar

Alexandr Katulskiy alexxty7

View GitHub Profile
@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(() => {
@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") {
# 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]]
}
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
@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


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:
Redis.current = Redis.new(:host => ENV["REDIS_HOST"], :port => ENV["REDIS_PORT"])
@alexxty7
alexxty7 / gitflow-breakdown.md
Created February 8, 2019 12:13 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@alexxty7
alexxty7 / other.rb
Last active February 6, 2019 16:29
names.select(&'John'.method(:==))
require 'uri'
HTTP_FORMAT = URI.regexp(%w(http https))
const maxByLength = (array) => {
if (!array.length) return [];
return array.sort((a, b) => b.length - a.length)[0];
}
const match = (pattern, text) => {
let tokens = pattern.toLowerCase().split(' ');
let textToSearch = text.toLowerCase();
let groups = [];