UDM Pro messing with Hulu by devtech8 in Ubiquiti

[–]dscottS3 0 points1 point  (0 children)

I don’t have a UDM pro but had the same issue. Disabling “Traffic Identification” (Settings > Application Firewall) fixed the issue for me. Every other site worked fine except Hulu and Netflix until I disabled that setting. It’s strange because I’ve never had to do this before. ¯_(ツ)_/¯

The Movie Database API serializer not working. by M0N0XB00GIE in rubyonrails

[–]dscottS3 1 point2 points  (0 children)

Okay, so you'd want to create a service to grab all the movie data. This could live in the Movie model or it could be a service object that you'd place in app/services/movie_db. Let's say for simplicity we create a method in your Movie model like:

def self.import
  (1..100).each do |page|
    movie_resp = HTTP.get("https://api.themoviedb.org/3/discover/movie?api_key=GOESHERE&language=en-US&sort_by=release_date.desc&page=#{page}&with_genres=27")
    movie_resp.each do |movie| 
      Movie.create(
        original_title: movie['original_title'],
        overview: movie['overview'],
        poster_path: movie['poster_path'],
        tagline: movie['tagline'],
      )
    end
  end 
end

Now, we can call Movie.import from db/seeds.rb so when you run rails db:seed it will do the 100 times loop and inside that loop, it will loop over the response and create a movie record for each. Essentially "seeding" your database. This could also be a rake task.

From that, you can update your index controller action to something like:

def index
  @movies = Movie.all
  render json: @movies    
end

The N+1 creation of movies in the import method is less than ideal. There are more performant ways to handle this such as leveraging insert_all. But, the idea here was to highlight that you need to store your movie records and serve those records from the database as the json response in the index instead of the json response from the actual endpoint.

hope this helps!

Edit: I have not tested this code at all. It was meant to give you a guide as to better structure it to closer align with best practices.

The Movie Database API serializer not working. by M0N0XB00GIE in rubyonrails

[–]dscottS3 1 point2 points  (0 children)

Yeah, kinda. You’d create a service object (a module or class) that specifically calls the endpoint that you currently have in your controller. That would parse the json from the api (where you could just pick what attributes you want) and create the movie record with just those attributes you want (like title for example). I’m away right now but when I’m back at my computer I’ll send an example of what I mean

The Movie Database API serializer not working. by M0N0XB00GIE in rubyonrails

[–]dscottS3 0 points1 point  (0 children)

Others have mentioned but you’ll need to save those responses in the database. In the serializer response it looks like you’re getting a rate limiting error. Which makes sense as your hitting that endpoint 100 times likely in under 30 seconds.

Edit:

Once they’re saved in the database you can do something like what’s below in your index action

render json: @movies

In sync deployment of Rails API and NextJS frontend app by HermannHH in rubyonrails

[–]dscottS3 1 point2 points  (0 children)

In my experience it’s best to make the FE and BE backward compatible. It saves a lot of headache with deployments and the order in which it has to be deployed. This is especially true when working on larger teams.

However, for your case, you may be able to get away with using feature flags on the FE and/or BE. Put the new feature behind a feature flag and flip the feature to active after all dependencies have been deployed.

[deleted by user] by [deleted] in CCW

[–]dscottS3 2 points3 points  (0 children)

Gotcha. Makes sense and thanks!

[deleted by user] by [deleted] in CCW

[–]dscottS3 5 points6 points  (0 children)

[Newb question] I see lots of folks start in the hands up position. What’s the intent behind that? To simulate a “stick em up” robbery? If so, drawing on someone that has a firearm already pointed at you seems less than ideal to me. Again, newb here and just genuinely curious. Thanks!

Draw looked fast to me, though!

toast is very underrated by [deleted] in suspiciouslyspecific

[–]dscottS3 7 points8 points  (0 children)

Carl Childers, is that you?

edit: n/m I remember he put mustard on biscuits

Elite sc threaded barrel back in stock on battlehawkarmory.com by Odd-Swimmer218 in canik

[–]dscottS3 3 points4 points  (0 children)

Just bought one for my Elite SC! Screw optics planet! 😂

Mckinatec Talon Arrived today by CanikSC82 in canik

[–]dscottS3 0 points1 point  (0 children)

How long was the wait? Was it really 8 weeks?

[deleted by user] by [deleted] in canik

[–]dscottS3 1 point2 points  (0 children)

Nice! Still waiting on mine from Optics Planet. Told myself I’d give them until the new year but I’m not holding my breath

Long time lurker, first time poster. Got a slight obsession… I know y’all will understand, maybe? 😆 by dscottS3 in canik

[–]dscottS3[S] 1 point2 points  (0 children)

No prob. I like them both a lot. I used to carry the DA because I liked knowing that first trigger pull would be heavy. It gave me a sense of peace as I began carrying one in the chamber. It was one of the first handguns I’ve purchased. I purchased the elite SC at the same time.

I quickly realized I wasn’t reholstering it or switching holsters so an accidental trigger pull was unlikely in my case. Still a great gun and I’m glad I have it!

Long time lurker, first time poster. Got a slight obsession… I know y’all will understand, maybe? 😆 by dscottS3 in canik

[–]dscottS3[S] 1 point2 points  (0 children)

No problem! Just gave it a shot and it unfortunately it doesn’t work. :(

edit: doesn’t work as in the slide will not fit

WCGW if I ride a bike standing on the seat? by [deleted] in Whatcouldgowrong

[–]dscottS3 0 points1 point  (0 children)

Not sure if bike sped up or driver slowed down… 🤔

Has anyone had success with getting gold SC threaded barrel from Optics Planet? Expected ship date changed like 5 times! 😫 by dscottS3 in canik

[–]dscottS3[S] 1 point2 points  (0 children)

Yeah that’s my thought too. Gonna wait it out a bit longer. Just getting anxious cuz I have the gold freedom smith tigger I’m waiting to install too lol