How are compiled CSS and JavaScript files handled with S3?

I have my Drupal site set up to upload public files into the S3 bucket but am having some strange behavior with different environments and different s3 buckets. I have 3 s3 buckets: one for our production environment, one for our staging environment, and one for my development environment. The Drupal configurations are set up to point to their respective s3 bucket based on environment.

There’s been a couple of instances now where our staging instance is working perfectly fine and it’s s3 bucket has the compiled css and js files, and then after a random deployment from development (not every deployment though) the staging instance is failing to load a css resource because it doesn’t exist in the respective S3 bucket because the css resource it’s trying to load actually exists in the development environment’s s3 bucket.

How does drupal handle loading these resources, like, where does it actually retrieve the filenames from? I’m just trying to figure out why it’s trying to retrieve a filename for a resource that was generated in development instead of the filename for a resource that it generates?

P.S.

The deployments never contain any of thing in the codebase related to which files to load.

javascript – Example of script-src-attr that is not already handled by script-src-elem

Content-Security-Policy: script-src-attr 'none'; script-src-elem 'unsafe-inline';

will allow inline scripts like <script> alert('I am inline') </script> but disallow event handlers in tags like onclick="alert('I am onclick')" and javascript-navigation <a href="window.open('...')".

It’s much safer than script-src 'unsafe-inline'; because about 90% XSS are based on badly sanitized user input lead to skip event handlers in tags, for example <img src=/ onerror="alert(String.fromCharCode(88,83,83))"></img>.

Otherwise:

Content-Security-Policy: script-src-attr 'unsafe-inline'; script-src-elem 'nonce-ebf34fd3';

will disallow inline scripts <script> ... </script> without nonce='ebf34fd3' attribute, but will allow inline event handlers and javascript-navigations.

This is suitable to craft more safe CSP for old sites with a lot of built-in event handlers.

Please note that as for now only Chrome supports script-src-attr / script-src-elem directives. Chromium-based Edge should support these, too.

django – Best Practice: Should cascading updates be handled by the frontend or the REST API?

I am designing a timesheet app for logging user tasks using React for frontend and Django REST Framework for backend. The database is PostgreSQL and I have a table for recording the tasks with 4 columns: date, start_time, duration, description.

I need a way to support the updating of a task after the user had created several. The problem is that each task is dependent on all the previous tasks, since its start_time will change if the duration of a task before it changes. So for example, suppose that task 1 has a start_time of 13:00 and a duration of 1 hour, task 2 has a start_time of 14:00 and a duration of 1 hour, and so on. If the user decided to update the duration of task 1 from 1 hour to 2 hours, that means the start_time of task 2 and all subsequent tasks must be increased by 1 hour.

I’m wondering what is the best way to implement such cascading updates. First option is to make the API backend responsible for it, so whenever the React frontend sends out a PUT request for a task, the DRF backend will not only update that task but also all subsequent tasks as well. Second option is to offload everything to the React frontend, making it responsible for sending out multiple PUT requests, for the updated task as well as all subsequent tasks.

I would think the first option of letting the backend handles everything is a better design, since this problem is technically a form of database constraint. But not too sure if it is appropriate for a REST API to handle. What would be the best practice in this case?

overflow – How should large table columns be handled on a responsive design?

There are a couple of implied assumptions in the scenario you’ve presented that, if thoroughly examined, will make your decision easier.

1 The data is tabular.

Just because you are returning records from a query and by default displaying them in a table, does not make the data “tabular” from a UI perspective. The key is that the primary function of tabular display is to compare multiple set items by one or more item characteristics. Think analysis of data. Grouping and sorting in tables are convenience options that make the analysis of the data easier to achieve using a single table, but are still secondary to the primary function of comparison.

Lists are usually better suited to displaying a set of data for the purpose of locating one or more items of interest based on a few key characteristics. Sorting and grouping a list of data facilitates bubbling items of interest to the top of the list for improved “findability”. Ordered lists imply sorting by one or more characteristics, and grouping is achieved by multiple sequential lists or sub-lists.

In my opinion, based on a cursory look at the data you linked, you may want to question whether the occasion of use for your data is more comparing or finding.

2 The mobile use case is fundamentally the same as the desktop use case

This is the big question that underlies the decision to “go responsive” only. Responsive design primarily addresses displaying (mostly) the same information on different screen sizes. In some situations, the mobile use case (context, user goals, info needs) is different enough from the desktop need that a responsive solution forces an unacceptable level compromise for one (or more) sets of users. When this happens, a distinct mobile solution is a better option.

In your case, I would decide first if the use cases are the same, or whether designing distinct experiences is a better fit. If they are the same, then examine the use case of the “tabular” data. If it’s primarily finding item(s), then go with a list based solution and employ sorting/grouping options and potentially collapse/expand list items (perhaps only on mobile) if it helps focus attention on the characteristics of primary interest.

If the use cases are the same, and comparison of multiple items by characteristic(s) is the primary purpose of the data display, then collapsing the table down to fit 320px by removing or hiding data is actually worse for the user than zooming and/or scrolling horizontally over the complete table. In this scenario, fully responsive design is not appropriate.

Sorry for the long-winded response – hope this helps you make a choice.

❕NEWS – $1.5 Trillion Transaction Handled By Ethereum In The First Quarter Of 2021 | Proxies-free

Date from Messari shows that the total transactions that has taken place in the ethereum smart contract network in the first quarter of 2021 is estimated to be $1.5 trillion.

Ethereum smart contract network is seen to be largest because of the DeFi and NFT project been run on it.

Arthur Hayes said the transaction is likely to increase to $6 trillion by th end of 2021.

My point is despite the increase in gas fee people still use the ethereum smart contract network, what could be responsible for this and do you see this having more positive impact in the price?.

unity – Should the interaction between the player and world objects be handled from the player class or as an event from the object classes?

Suppose you’re making a 3D platformer like Super Mario, if you jump on a Goomba, does Mario (the class) know that it just landed on a Goomba and then tell that Goomba to die, or does the Goomba realize that he is being smashed and dies ?

I want to go with the first approach but it will end up with a huge If/then (or Switch/Case) script, also the reason why this is “problematic” is that many objects will make the player have a “reaction”, for example if you land on a Goomba, you don’t just kill it, but it forces you to jump, that jump event, what’s the best way to handle it ?

Thanks

Dell 19″ display not being handled properly by Ubuntu

During install of Ubuntu 20.04, Center of display would start in center with darkening, then the spot would get larger, obliterating the content. Able to get Ubuntu installed and re-booted. Came up with highly pixelated screen, weird colors. Only able to get certain areas to show proper content. Hitting Escape key occasionally would get the content to show properly. Total screen NEVER did show correctly.
Tried resetting the Dell internal settings to factory settings. Did NOT help.
During re-boot, the UBUNTU and logo with circling logo appear normal and correct.
Tried swapping the display with another Dell 19″ that was connected to my iMac. Same results. Ubuntu is not using correct drivers or settings of some type correctly.
Picture of screen following reboot

dnd 5e – How should rests be handled inside the Tomb of of the Nine Gods?

Well, first of all, a long rest is only interrupted by an hour or more of activity, so it’s pretty difficult to deny the party their long rests:

If the rest is interrupted by a period of strenuous activity – at least 1 hour of walking, fighting, casting spells, or similar adventuring activity – the characters must begin the rest again to gain any benefit from it.

Short rests, however, are more easily interrupted and denied, so that’s where the DM really needs to decide how to handle them, and what to allow the party to take:

A short rest is a period of downtime, at least 1 hour long, during which a character does nothing more strenuous than eating, drinking, reading, and tending to wounds.

This is also where some spells can be very helpful (or completely useless if the party never needs them), such as Catnap (take a short rest in 10 minutes instead of an hour), or Rope Trick to rest in, and so on.

design patterns – Should @media queries be handled from smaller to larger sizes or vice-versa?

You can find the term “mobile-first design” all over the web. But should that design principle apply to the way media queries (for screen sizes) are used?

For example:

Let’s say we need to implement a break point to toggle the display: flex; property on some div

If you’d apply the “mobile-first” design principle, I guess you should do it like this:

.someDiv {
  display: block;                // DEFINE THE "MOBILE" BEHAVIOR
  @media (min-width: 600px) {    // ADJUST IT FOR LARGER SCREEN
    display: flex;
  }
}

That’s really counter intuitive to me. I’m basically “telling” the small layout how to behave in a larger environment.

I think it’s much more intuitive to “tell” a larget layout how to behave on a smaller environment. Because if you don’t do it, your layout is probably gonna leak and you get nasty scroll bars all over the place.

I would prefer something like this:

.someDiv {
  display: flex;                // DEFINE THE "DESKTOP" BEHAVIOR
  @media (max-width: 600px) {   // ADJUST IT FOR A SMALLER SCREEN
    display: block;
  }
}

I’m asking this here because I’d like to know if there is a best practice for this situation. If this is a matter of preference, I’ll definitely go with 2nd option above. But if the whole industry works in a certain way, maybe I should just adapt my way of thinking.