142157?v=3&s=150

dancinglightning

Joined 10/22/2016
# Name
142157?v=3&s=64
dancinglightning said about 1 year 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 ?

thx


635114?v=3&s=64
kobaltz PRO said about 1 year 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).

142157?v=3&s=64
dancinglightning said about 1 year 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)

  end

  block

end

 

142157?v=3&s=64
dancinglightning said 12 months 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.

Thanks

Torsten

635114?v=3&s=64
kobaltz PRO said 12 months 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.

142157?v=3&s=64
dancinglightning said 7 months 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 ?

635114?v=3&s=64
kobaltz PRO said 7 months 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'.

142157?v=3&s=64
dancinglightning said 6 months ago:

Yes, thanks for that.

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

635114?v=3&s=64
kobaltz PRO said 6 months ago:

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

142157?v=3&s=64
dancinglightning said 2 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. 

635114?v=3&s=64
kobaltz PRO said 2 months ago:

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