| title | date |
|---|---|
Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 20.04 |
2020-10-16 |
Инструкцию для Убунту 18.04 см. здесь.
| import ( | |
| "fmt" | |
| ) | |
| func main() { | |
| biMap := NewBiMap() | |
| biMap.Put("apple", "likey") | |
| biMap.Put("orange", "no likey") | |
| v, _ := biMap.GetByValue("no likey") | |
| fmt.Println(v) |
| func initLogger() { | |
| var logLevel = logrus.InfoLevel | |
| if debug { | |
| logLevel = logrus.DebugLevel | |
| } | |
| rotateFileHook, err := rotatefilehook.NewRotateFileHook(rotatefilehook.RotateFileConfig{ | |
| Filename: "logs/console.log", | |
| MaxSize: 50, // megabytes | |
| MaxBackups: 3, |
| title | date |
|---|---|
Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 20.04 |
2020-10-16 |
Инструкцию для Убунту 18.04 см. здесь.
Rails provide a few ways to load associated data and before moving forward let’s consider one scenario as below,
there is a User table that has a one-to-many association with the Post table. With the scenario set, let’s begin with our discussion.
The Joins works perfectly fine for comparing and filtering data using associated data.
One way to do this is to use bundler to scaffold our gem:
bundler gem my_gem
I prefer to put tasks meant to manage the gem itself in lib/tasks, and tasks the gem is meant to provide to gem users in lib/my_gem/tasks.
| rspec-mocks - main documentation https://github.com/rspec/rspec-mocks | |
| mocks - blocks with args and CALLing - https://mixandgo.com/learn/ruby/minitest-rspec | |
| https://stackoverflow.com/questions/26366799/rspec-yield-block-but-call-original | |
| https://stackoverflow.com/questions/38329024/how-can-i-appropriately-mock-out-a-method-that-returns-yield | |
| https://stackoverflow.com/questions/73184311/rspec-allow-block-to-run |
| class SomeEntity | |
| def run | |
| transaction do | |
| mark_non_eligible | |
| make_invoice_batch | |
| send_batch_email | |
| end | |
| end | |
| def transaction |
| https://github.com/codevise/activeadmin-searchable_select | |
| # NOTE (MBerkovich): Оставить как пример на будущее | |
| # f.input :attendees_ids, include_blank: true, input_html: { class: "chosen-select" }, | |
| # collection: User.all, multiple: true,include_hidden: false, include_hidden: false |