Joined 10/22/2016
# Name
dancinglightning said almost 2 years ago:

Nice. Maybe next some on how to cache (an expire) actual models with association.

But my question: Was there something about the ubuntu install ? Specifically how to autostart that?

And for a shared host (many apps, many mysql's ) , are different db or namespaces or redis instances better ?


kobaltz PRO said almost 2 years ago:

I'll usually use the same database but different namespaces. However, I will put services on their own database. For example, if I were using Redis for caching as well as storing the User Sessions, I would put caching on db 0 and the sessions on db 1. This makes it easier to flush all of the stored cache without wiping out the user sessions (or vice versa).

dancinglightning said almost 2 years ago:

Very nice. I use it on every app nowadays. Throtteling off course, but also to deal with probes:

Rack::Attack.blacklist('block admin probes') do |req|

  # Request are blocked if the return value is truthy

  block = false

  ["php" , "jsp" , "cgi", "asp", "cfm," "proxy.txt", "soapCaller", "Win32" , "HNAP1" , "w00tw00t",

    "pma" , "mysql" ,"msd" , "MySQL" , "jmx-console" , "ervlet" , "xml" , "cart" ,"install"].each do |no|

    block = true if  req.path.include?(no)





dancinglightning said almost 2 years ago:

Thanks, actually for that whole series on sidekiq. Maybe some testing coming up ?

Having deployed the cron, i had to restart the sidekiq service. Off course. 

As you have everything else nicely setup for copy/paste, adding the schedule.yml file would make it even easier for the next guy.

And i must admit that at first hearing i also understood that this was only for use with enterprise edition. Only a bit of checking and listening again cleared that up.



kobaltz PRO said almost 2 years ago:

I do plan on doing some testing. However, I think week after next, I'll be focusing on searchkick/elasticsearch.

I've updated the episode with the schedule.yml file. That was definitely an oversight, so thank you.

dancinglightning said over 1 year ago:

Nice idea of splitting large route files. 

But am i misunderstanding something or could you just as well use require_relative , either directly or instead of the instance_eval ?

kobaltz PRO said over 1 year ago:

The code will start to get messy. You wouldn't be able to simply extract out the routes into another file. You would have to still use the Rails.application.routes.draw, but then would also need to figure out how to not overwrite what you've already required. The method that I've demonstrated in this episode was fairly unobtrusive.

You could however, do something like this

config.paths["config/routes"] += Dir[Rails.root.join('config/routes/*.rb’)]

And it would probably have a similar effect, however, I don't think that it is as 'clean'.

dancinglightning said over 1 year ago:

Yes, thanks for that.

Did you see a way of getting from actual addresses to those coordinates that you used ?

kobaltz PRO said over 1 year ago:

Check out episode 84 where the geocoding from street address to coordinates is done via the geocoder gem.

dancinglightning said 12 months ago:

Nice one.

Creating the models with factory_girl makes for much better reuse and smaller code.

And adding guard and autosave in the mix, the workflow has less steps and is much faster. 

kobaltz PRO said 12 months ago:

Agreed, will be covering both of those in upcoming episodes.