dev.mensfeld.pl
Rails | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/category/rails
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Errbit HTTPS: Setting up Errbit reporter (Airbrake v5 gem) to work with self-signed HTTPS certificate. If you’re using old Errbit version (0.2.0, 0.4.0) and an old Airbrake version (v4) please refer to this manual. To make it work with self-signed certificates. Airbrake: HTTP error: SSL connect returned=1 errno=0 state=unknown state: certificate verify failed. OpenSSL: SSL: VERIFY PEER = OpenSSL: SSL: VERIFY NONE. To make it work:. Module ...
dev.mensfeld.pl
ActiveSupport | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/tag/activesupport
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! ActiveRecord isolated, namespaced scopes and methods using instance exec and ActiveSupport: Concern. Are a really good way to provide shared functionalities into your models. For example you can add scopes and then apply them in multiple classes:. Module Statistics extend ActiveSupport: Concern included do scope :disabled, - { where(disabled: true) } end end class Host include Statistics end. Proxy object and instance exec as a solution.
dev.mensfeld.pl
Backup (mysql dump) all your MySQL databases in separate files | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/2013/04/backup-mysql-dump-all-your-mysql-databases-in-separate-files
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Backup (mysql dump) all your MySQL databases in separate files. Sometimes we would like to dump all the MySQL databases. MySQL provides an easy solution to this problem:. Mysqldump -u root -p - all-databases all dbs.sql. However this will dump stuff into one file. How to dump all databses into separate files? Well, here is my solution. A small bash script:. Very nice idea, very creative and I just used it to backup a server. Mkdir -p $BACK...
dev.mensfeld.pl
Ruby On Rails | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/tag/ruby-on-rails
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Ruby on Rails, Mysql2: Error: Incorrect string value: ‘ xF0 x9F x99 x82’ and Specified key was too long; max key length is 767 bytes. If you get error like this one:. Mysql2: Error: Incorrect string value: ' xF0 x9F x99 x82'. It means that you use verion of Mysql with settings that does not support full Unicode. Changing that in Ruby on Rails should be fairly simple:. However you might encounter following error:. To fix that you need to:.
dev.mensfeld.pl
Dragonfly | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/tag/dragonfly
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Ruby: Dragonfly gem – auto-orient for all the images. Block with an auto orient command and you are ready to go! Class Picture ActiveRecord: Base extend Dragonfly: Model dragonfly accessor :image do after assign do attachment # Auto orient all the images - so they will look as they should attachment.convert! Auto-orient' end end end. Of course, they would probably get cached, so they would not take much time, but still, there’s a bet...
dev.mensfeld.pl
ImageMagick | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/tag/imagemagick
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Ruby: Dragonfly gem – auto-orient for all the images. Block with an auto orient command and you are ready to go! Class Picture ActiveRecord: Base extend Dragonfly: Model dragonfly accessor :image do after assign do attachment # Auto orient all the images - so they will look as they should attachment.convert! Auto-orient' end end end. Luckily there’s a Quickerclip. That stubs Paperclip methods, allowing it to run faster. There’s o...Also we...
dev.mensfeld.pl
Running with Ruby - Dev Blog not only for Rails fanatics - Part 3
http://dev.mensfeld.pl/page/3
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Dry-Configurable lazy evaluated default settings. Dry-configurable is a simple mixin to make Ruby classes configurable. It is quite nice, uses Struct and allows you to have default values. Unfortunately, it does not support (yet hopefully) default values that are evaluated upon each setting key request. When would that be useful? Super().call : super() end end end. To make it work with self-signed certificates. Having an error catcher like...
dev.mensfeld.pl
Maciej Mensfeld | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/author/admin
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Apache Zookeeper Apache Kafka start / restart script. During my work on Karafka framework. I have to start/stop/restart Apache Kafka and Zookeeper quite often. Here’s a short script that will pull the most recent version of Kafka and Zookeeper, will run them and print their IPs. Note, that it will also stop Kafka and Zookeeper if they were running. Grillrb 2016 – Poland’s first outdoor conference review. 1111oneone” IT event ever....
dev.mensfeld.pl
Ruby | Running with Ruby - Dev Blog not only for Ruby on Rails fanatics!
http://dev.mensfeld.pl/category/ruby
Running with Ruby – Dev Blog not only for Ruby on Rails fanatics! Grillrb 2016 – Poland’s first outdoor conference review. It’s about time to summarize some of the conferences that I’ve recently attended to. This post will be about Grill.rb. That organizers claim to be “Poland’s first outdoor conference”. I was quite skeptical. About that claim, but after I couldn’t find any other Poland’s outdoor conferences, I must admit that :). Place, with some trees giving us a bit of shadow to hide from the sun.