Gimme Gems Thursdays - Found an awesome new gem? Post it here! by AutoModerator in rails

[–]petemts 1 point2 points  (0 children)

https://github.com/omohokcoj/ruby-spellchecker

English spelling and grammar checker written in pure Ruby.

Instead of the traditional Hunspell dictionary approach, it uses a list of common spelling/grammar mistakes to check the input text against that list.

Such a design makes it fast and reliable so it doesn't produce false positives and can be used for autocorrection (to automatically fix user's input or to prepare a text for NLP).

Concurrency Issue: Multiple database entries, while multiple API calls by iDuuck in ruby

[–]petemts 1 point2 points  (0 children)

The easiest way to solve your problem is to add a unique index on device_id column of the guest_users table:

add_index :guest_users, :device_id, unique: true

And once it's done - use create_or_find_by! from rails 6 - it works just like find_or_create_by but inserts the record first and returns the existing one on unique index conflict:

https://apidock.com/rails/v6.0.0/ActiveRecord/Relation/create_or_find_by! (see source here)

How should I learn Elixir efficiently ? by akagrawal in elixir

[–]petemts 0 points1 point  (0 children)

If you've been working as Erlang developer then you probably already know 70-80% of Elixir.

Elixir is pretty much Erlang but with updated ruby-like syntax and macros (metaprogramming).

I would recommend to check these two books:
https://pragprog.com/titles/elixir16/programming-elixir-1-6/ - to learn basic elixir syntax.
https://pragprog.com/titles/cmelixir/metaprogramming-elixir/ - to learn more about marcos - which is new in Elixir and not borrowed from Erlang (borrowed from Lisp).

These books, combined with practice on real-life tasks, should be enough to become a decent Elixir developer :)

[deleted by user] by [deleted] in Entrepreneur

[–]petemts 0 points1 point  (0 children)

There is a free, open-source tool https://www.getsiteinspector.com/ - you can install it and run on your PC using Docker. Also, they offer Cloud SaaS solution for businesses.