Skip to content

Instantly share code, notes, and snippets.

View stiig's full-sized avatar

Vasiliy Matyushin stiig

View GitHub Profile
@stiig
stiig / 00.md
Created April 8, 2017 13:07 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@stiig
stiig / mysql.database.yml
Created February 5, 2024 08:55 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@stiig
stiig / index.js
Created March 25, 2025 12:34
Solution for making radio buttons uncheckable
$('.radio_with_uncheck').on('click', 'input[type="radio"]', function() {
var $radio = $(this);
var group = $('input[name="' + this.name + '"]');
if ($radio.prop('checked') && $radio.data('was-checked')) {
$radio.prop('checked', false);
}
group.data('was-checked', false);
$radio.data('was-checked', $radio.prop('checked'));
@stiig
stiig / index.js
Created March 25, 2025 12:35
Solution for making checkboxes behave like radio buttons
$('.checkbox_like_radio').on('click', 'input[type="checkbox"]', function() {
$(this)
.closest('.checkbox_like_radio')
.find('input[type="checkbox"]')
.not(this)
.prop('checked', false);
});