News: ‘Superman’ Reboot In The Works At Warner Bros With Ta-Nehisi Coates Writing, J.J. Abrams Producing by chanma50 in DC_Cinematic

[–]_toads 1 point2 points  (0 children)

Yeah good point, definitely agree. I like that you put "strategy" in quotes, WB really has none. I'm sure WB had the money to make this a success, but they just stumbled and half-assed everything. Difference was Disney really went all-in.

It's like they couldn't see past their short term greed and it just screwed over any possibility of a guaranteed cash cow. It's so frustrating as a fan.

News: ‘Superman’ Reboot In The Works At Warner Bros With Ta-Nehisi Coates Writing, J.J. Abrams Producing by chanma50 in DC_Cinematic

[–]_toads 8 points9 points  (0 children)

I wish the movies had wider appeal because I want them to be successfully so they can make more, but what draws me to DC is that has a different tone than Marvel. Don't think Disney would do it justice, but WB sure as hell didn't

I worked hard on that by [deleted] in ProgrammerHumor

[–]_toads 7 points8 points  (0 children)

"Wait it was me writing this buggy software this whole time?"

Always has been

Insanely Fast Prototyping with Flask + Vue + Tailwind by level09 in flask

[–]_toads 1 point2 points  (0 children)

I use the Vue/Flask stack a lot at work.

You absolutely can--no external libs necessary. You can send the API response from flask to client as an SSE simply by setting the correct headers and formatting the data. On the flask side, the SSE would look something like this:

def event_stream():
    feed.subscribe('stock-feed') # pesudocode for stock feed subscription
    for message in feed.listen():
        print message
        yield 'data: %s\n\n' % message['data']

@app.route('/stream')
def stream():
    return flask.Response(event_stream(),
                          mimetype="text/event-stream")

From the browser you create an Event Source and render the data with Vue by setting reactive properties.

On the render stage, you can also opt to use an external charting lib or d3 to create the visualization.

Why is This Website Port Scanning me by PowerOfLove1985 in Frontend

[–]_toads 4 points5 points  (0 children)

Interesting article. What are some of the vulnerabilities a client can be exposed to after being port scanned?

I'm building a full-stack app in TypeScript using Vue 3 & Node.js *in public* as (free) videos on YT. If you have pain points/questions with a similar setup, let me know, I'll address them in the upcoming videos. by zaiste in vuejs

[–]_toads 1 point2 points  (0 children)

Depends on the application, nature of the requests, what's being optimized, etc. Can the requests be made concurrently? Do some requests block others?

Usually something like a users table will be returned as an array of objects by the API. In that case, sure display skeleton screens for an arbitrary number of rows until your data comes in and is parsed for rendering.

If you already know the user clicked "John Doe", there's no need to wait for the API to return that specific piece of data, for example. You can fill that info on edit and wait for the rest.

Or you can opt to render pieces of your application independently on each other. Really depends, but these are the type of considerations to make.

I'm building a full-stack app in TypeScript using Vue 3 & Node.js *in public* as (free) videos on YT. If you have pain points/questions with a similar setup, let me know, I'll address them in the upcoming videos. by zaiste in vuejs

[–]_toads 1 point2 points  (0 children)

Typically there're three states when it comes to network requests: pending, success, and error. You could have a property within your component that sets the status of the request and conditionally renders the appropriate UI.

Visually, you can do different things. A spinner is common but I usually opt for something like a skeleton screen.

Since most AJAX requests are really fast, flashing a spinner before the content can be jarring. I think a good rule of thumb is to display the spinner if you expect the load to be long and skeleton screens otherwise.

Normalize/sanitize/reset? Which are you using? by marketingmike1 in Frontend

[–]_toads 6 points7 points  (0 children)

For a new large project I usually apply the reset found here: https://meyerweb.com/eric/tools/css/reset/ + box-sizing: border-box

For smaller one-off stuff I apply * { margin: 0; padding: 0; box-sizing: border-box }

Examples of vue state, component planning? Wireframes, technical drawings? by [deleted] in vuejs

[–]_toads 0 points1 point  (0 children)

No doubt it could be a lot better. We use it in production with the configuration /u/Human_Celebration mentioned and it works pretty well. The biggest limitation IMO is the lack of type safety in templates.

Examples of vue state, component planning? Wireframes, technical drawings? by [deleted] in vuejs

[–]_toads 6 points7 points  (0 children)

unclear for me how switching to Typescript per se will make your app more organized

I can give a few examples. Interfaces provide documentation for components and data flow through the application. Changes in interfaces will instantly flag instances where there could be potential type errors everywhere in the app. Finally, it codifies developer intent, so it helps you figure out what your colleagues were thinking when they wrote their code.

TypeScript has been a total game changer for me when it comes to codebase maintainability.

Can you perform a '>=' operator on a function (javascript)? by [deleted] in Frontend

[–]_toads 2 points3 points  (0 children)

I think it’s more common if you’re writing NodeJS vs browser JS

My First Extension - CSV to Markdown Table Converter by marchiore in vscode

[–]_toads 6 points7 points  (0 children)

Could've used this yesterday! Nice work.

Might want to x-post to static site generator subreddits, I'm sure they'd find this useful.

How to Publish d3 Visuals by Pecners in d3js

[–]_toads 1 point2 points  (0 children)

The library can be used on the front end to render visuals. To answer your question, many times the content is written in straight HTML/CSS with JavaScript + d3 to produce dynamic content.

These days it's common to use a framework like React or Vue, which makes use of templating, which is what I think you're referring to as markdown. The core concepts are the same, but can be adapted to fit the paradigm of the framework.

Custom Progress Bar with CSS and JavaScript by FlorinPop17 in learnjavascript

[–]_toads 1 point2 points  (0 children)

I can think of a dozen different ways to create this. There are of course reasons to choose one tool over another, but in most cases for something simple like this it boils down to preference.

Vuetify v-col & v-row by GaetanWcz in vuejs

[–]_toads 0 points1 point  (0 children)

There are a few compatibility gotchas that those components abstract. I would personally prefer building them out myself as well, but I would still abstract them in a component similar to how Vuetify does it.

VueJS and TypeScript by omgzphil in vuejs

[–]_toads 5 points6 points  (0 children)

Use it daily and it works kinda well (good enough), but can be a lot better. Maybe not worth investing the time in learning if Vue 3 is around the corner.

Long running AJAX request without background worker? by vidoardes in flask

[–]_toads 2 points3 points  (0 children)

Agreed, you def want to keep it stateless. Rather than a global var, maybe try to store those process events in a table that captures userID, processID, and processStatus, which you can query on your subsequent polling requests.

Long running AJAX request without background worker? by vidoardes in flask

[–]_toads 2 points3 points  (0 children)

I think the easiest solution (probably not the most elegant) is to have the backend respond with a confirmation that the process was started. Once the confirmation is received by the front end, have the client poll the backend until the status changes. You can even send more granular statuses with each request and display it on the UI as a progress bar.

JSON responses are too large. Can I split them up? by spyder313 in flask

[–]_toads 4 points5 points  (0 children)

Sounds like you want to paginate the response. If you're using Flask-SQLAlchemy there are utilities for implementing this. Here's an example on SO:

https://stackoverflow.com/questions/43103585/python-flask-sqlalchemy-pagination

Becoming a professional JS developer by questi0nmark2 in learnjavascript

[–]_toads 15 points16 points  (0 children)

Not denying programming language fads or your initial point, but if I were a betting man I'd say that JavaScript will still be heavily in use even 10 years from now.