r/webdev - Push an object to an array using mongoose.
Strategy

Push an object to an array using mongoose. : webdev


My user schema has an empty array called games. I want to push different objects to that array that contain two properties. The problem is that instead of pushing like nameObj: { name: ‘name’, win: 0 }, what ended to be pushed is between another { }. I don’t know how should I push properly.

Here’s my method.

app.get('/update-user', (req, res) => {
    User.findOneAndUpdate(
        { username: 'katana_user' },
        { $push: { games: { sfv: { name: videogames.sfv.name, wins: 0 } } } }, (err, success) => {
            if (err) {
                console.log(err);
            } else {
                console.log(success);
            }
        });
});

I’d appreciate any help possible!

r/webdev - Push an object to an array using mongoose.



Source link

Tornado locations (preliminary), Jan1-Apr30, 2018
Strategy

5 Essential Elements for Developing and Delivering GIS Solut…


Developing a GIS solution is important when performing analysis tasks over specific geographic areas. A GIS or Geographic Information System is a software that captures geographic information and utilizes the data for manipulation, viewing, and analysis depending on which context or parameters it is required.

The potential solution that a GIS can provide is endless. 

Big or small, many businesses and institutions rely heavily on geographic data to understand the demographic areas of possibilities. For example, a fast-food center aiming to maximize its catchment area and accessibility will look for demographic information collected from the busiest roads, the best junctions, and leisure centers such as shopping malls and multiplex theatres.

A telecom provider will need to understand if the network condition over a region is good. If not, then they will work on delivering optimized solutions.   

As you can see, geographic data is crucial for all business making decisions. But geographic data alone is useless without attribute data (any data that gives you useful information about a particular area, population, network strength, quality, etc), which can be Continuous data or Discrete data.

The question now that must be lurking in your mind is, how would all this information help you develop a solution? This is where GIS comes in. GIS Provides Multiple Source Data Compilation and Single Data Representation 

GIS works based on four elements. These elements may be unrelated, but, when brought together, serve as a useful source of information. These four elements are— 

  1. Data acquisition
  2. Data storage and retrieval
  3. Data transformation and analysis
  4. Reporting

The compiled data is then presented on a single graphical user interface and from there further analysis work continues.

Take a look at how GIS data representation becomes a useful source of information and solution. The following map shows potential areas reported to be prone to tornadoes between Jan 1 – April 30, 2018.

Tornado locations (preliminary), Jan1-Apr30, 2018

Fig. 1 —  Spatial Discrete Data Representation

The second map shows the average monthly temperature in the contiguous United States as recorded in April 2020.

Average monthly temperature in the contiguous United States

Fig. 2 —  Spatial Continuous Data Representation

About GIS Maps

Maps are considered the simplest form of visual representation of data. It can become a highly interactive analysis tool when combined with different data interpretation and color segregation methodologies.

Below is a GIS map representing America’s racial diversity using precisely 308,745,538 million dots of data. On the map, each value is color-coded to represent an individual dot’s ethnicity. For example, the blue dots represent Caucasian, the green dots represent African American, the red dots represent Asian, the orange dots represent Hispanic, and the brown dots represent Other / Native American / Multi-Racial.

GIS map representing America's racial diversity


I like the map mainly because of the way the values are displayed using colors. However, what if I want to get a more granular view of the map? Would zooming help? Or would it lead to data overlapping? (I think binning would make better data representation on the map than data points. However, that’s another topic of discussion entirely.)

Creating a Web Application With GIS Map Support

Developing and delivering a web application with a GIS solution calls for a proper understanding of the elements used for developing a GIS application.

These elements are— 

  • A web application
  • Digital base maps
  • Operational layers
  • Tasks and tools
  • Geodatabases

When the elements are combined, we can build a framework for delivering GIS solutions to end-users. All of these elements are accessible either through the web or through the Local Area Network.

Below is a sample diagram showing a GIS application framework.

Sample diagram showing a GIS application framework

A brief introduction to each element will give you a better understanding.

1. Web Application

A web application provides a software interface to the client — the user point of contact with the application.

The type of web application that you want to develop will depend on which tools the user will use. Also, how the users will view the data.

There are instances where the user’s computer setup and internet speed will matter.  

2. Digital Databases

The base maps are what will provide the geographic context to the web GIS application. For example, applications providing recommended optimization solutions to telecom providers for a selected area would require some of the following base maps displaying terrain and transportation. Choosing the right base map type depends a lot on the user’s work. Some applications will provide users with only one base map type and some applications will provide users with multiple base maps. Developers will need to decide which base map to set as default.

Some names of base map types:

  • Street Maps: This is the most common default map type used in software applications for an urban context. Users can zoom in to find more details.
  • Satellite / Aerial Imagery: This type of map is ideal for survey works such as agricultural or environmental mapping. However, this type of map is not suitable for performing statistical analysis. Make sure you check the resolution and the age to get the most up-to-date map.

3. Operational Layers

These are a small set of layers that you work with directly or produce when running an operation, such as running a query. Layers are tailored to the type of users who are going to use the application. For example, an urban planner will use the GIS application to update the location with information about manhole covers in a sanitary sewer/stormwater system layer. But an urban area analyst will be using the GIS application to view the map where the manhole covers are located. So the layers for an urban planner will be different from the ones used by urban area analysts.

Operational layers will consist of:

  • Editing and data access layers: These are map layers used for editing features, performing queries, and feature selection for analysis.
  • Query results: Applications will send a query request to the server, to which the server will respond by sending a set of records as results. These can include a set of attribute records or individual features. The query results are displayed as map graphics.
  • Result layers derived from analytic model: GIS analysis performed to derive new information, can be added as new map layers. These map layers can be explored, visualized, interpreted, and compared.

Operational layers are dynamic and are retrieved from the GIS database based on the query run.

They are displayed at runtime every time a user zooms or pans the map. In contrast to the base maps that use wide range map scales, operational layers work within a focused range of map scales and resolutions.

How an operational layer is stacked together with other layers and the base map will vary. In some applications, it is displayed on top of the base map to provide geographic context. Again, in some applications, the operational layer is displayed underneath other layers to provide location context. For example, to provide location context for displaying postal code areas by demographic information, the results are often overlaid with transportation lines and place names.  

4. Task Tools

The toolsets added to the application can be common types ranging from the search tool for finding an address or the area selection tool for selecting a region on the map. It can be more specific tools used for running calculations to find out the potential places where network conditions could be worst.

Here are two ways by you which you can determine the tool usage—

  • Having the server do it: Used when a required data is not housed on the client-side and running a calculation query on a given dataset becomes a complex process. Typical examples include finding and routing to the closest facility or finding the best habitat.
  • Having the client do it: It is more suitable when all the data required is present on the client-side. For example, when the set of point features required for generating a heat map is already present on the client-side.

5. Geodatabases

Geographic data is useful not just for running a query and displaying results on the base map. Geodatabases can support all levels of implementation in GIS. The information stored in geodatabases is of immense value when addressing a broad range of questions. Typically a strong geospatial data management framework includes one or more geodatabases.

Conclusion

Designing and developing GIS applications can be either simple or complex. It depends on how your framework looks. If your service or product requires dealing with geographical spatial data, then a GIS solution is the right choice. Whether it is an application for finding nearby taxis or planning civil engineering projects, with GIS tools and associated libraries, you can create and deliver the most versatile solutions.



Source link

r/webdev - different videos in the same DIV, HELPPPPPPP
Strategy

different videos in the same DIV, HELPPPPPPP : webdev


Hello, I am new to this world of web development. I am currently in a project to continue learning and I have been stuck on this part…

I want to make a player like this page, where it is a div where the video will be played but there are different options where if you choose a reload another different video BUT IN THE SAME DIV … I don’t know if I explain myself and for me it is being very confusing :/, Thanks for the help

r/webdev - different videos in the same DIV, HELPPPPPPP



Source link

Building an Ethereum app using Redwood.js and Fauna
Strategy

Building an Ethereum app using Redwood.js and Fauna


With the recent climb of Bitcoin’s price over 20k $USD, and to it recently breaking 30k, I thought it’s worth taking a deep dive back into creating Ethereum applications. Ethereum, as you should know by now, is a public (meaning, open-to-everyone-without-restrictions) blockchain that functions as a distributed consensus and data processing network, with the data being in the canonical form of “transactions” (txns). However, the current capabilities of Ethereum let it store (constrained by gas fees) and process (constrained by block size or size of the parties participating in consensus) only so many txns and txns/sec. Now, since this is a “how to” article on building with Redwood and Fauna and not an article on “how does […],” I will not go further into the technical details about how Ethereum works, what constraints it has and does not have, et cetera. Instead, I will assume you, as the reader, already have some understanding about Ethereum and how to build on it or with it.

I realized that there will be some new people stumbling onto this post with no prior experience with Ethereum, and it would behoove me to point these viewers in some direction. Thankfully, as of the time of this rewriting, Ethereum recently revamped their Developers page with tons of resources and tutorials. I highly recommend newcomers to go through it!

Although, I will be providing relevant specific details as we go along so that anyone familiar with either building Ethereum apps, Redwood.js apps, or apps that rely on a Fauna, can easily follow the content in this tutorial. With that out of the way, let’s dive in!

Preliminaries

This project is a fork of the Emanator monorepo, a project that is well described by Patrick Gallagher, one of the creators of the app, in his blog post he made for his team’s Superfluid hackathon submission. While Patrick’s app used Heroku for their database, I will be showing how you can use Fauna with this same app! 

Since this project is a fork, make sure to have downloaded the MetaMask browser extension before continuing.

Fauna

Fauna is a web-native GraphQL interface, with support for custom business logic and integration with the serverless ecosystem, enabling developers to simplify code and ship faster. The underlying globally-distributed storage and compute fabric is fast, consistent, and reliable, with a modern security infrastructure. Fauna is easy to get started with and offers a 100 percent serverless experience with nothing to manage.

Fauna also provides us with a High Availability solution with each server globally located containing a partition of our database, replicating our data asynchronously with each request with a copy of our database or the transaction made. 

Some of the benefits to using Fauna can be summarized as: 

  • Transactional 
  • Multi-document 
  • Geo-distributed 

In short, Fauna frees the developer from worrying about single or multi-document solutions. Guarantees consistent data without burdening the developer on how to model their system to avoid consistency issues. To get a good overview of how Fauna does this see this blog post about the FaunaDB distributed transaction protocol. 

There are a few other alternatives that one could choose instead of using Fauna such as: 

  • Firebase 
  • Cassandra 
  • MongoDB 

But these options don’t give us the ACID guarantees that Fauna does, compromising scaling. ACID stands for: 

  • Atomic:  all transactions are a single unit of truth, either they all pass or none. If we have multiple transactions in the same request then either both are good or neither are, one cannot fail and the other succeed. 
  • Consistent: A transaction can only bring the database from one valid state to another, that is, any data written to the database must follow the rules set out by the database, this ensures that all transactions are legal. 
  • Isolation: When a transaction is made or created, concurrent transactions leave the state of the database the same as they would be if each request was made sequentially. 
  • Durability: Any transaction that is made and committed to the database is persisted in the database, regardless of down time of the system or failure.

Redwood.js

Since I’ve used Fauna several times, I can vouch for Fauna’s database first-hand, and of all the things I enjoy about it, what I love the most is how simple and easy it is to use! Not only that, but Fauna is also great and easy to pair with GraphQL and GraphQL tools like Apollo Client and Apollo Server!! However, we will not be using Apollo Client and Apollo Server directly. We’ll be using Redwood.js instead, a full-stack JavaScript/TypeScript (not production-ready) serverless framework which comes prepackaged with Apollo Client/Server! 

You can check out Redwood.js on its site, and the GitHub page.

Redwood.js is a newer framework to come out of the woodwork (lol) and was started by Tom Preston-Werner (one of the founders of GitHub). Even so, do be warned that this is an opinionated web-app framework, coming with a lot of the dev environment decisions already made for you. While some folk may not like this approach, it does offer us a faster way to build Ethereum apps, which is what this post is all about.

Superfluid

One of the challenges of working with Ethereum applications is block confirmations. The corollary to block confirmations is txn confirmations (i.e. data), and confirmations take time, which means time (usually minutes) that the user must wait until a computation they initiated (either directly via a UI or indirectly via another smart contract) is considered truthful or trustworthy. Superfluid is a protocol that aims to address this issue by introducing cashflows or txn streams to enable real-time financial applications; that is; apps where the user no longer needs to wait for txn confirmations and can immediately follow-up on the next set of computational actions. 

Learn more about Superfluid by reading their documentation.

Emanator

Patrick’s team did something really cool and applied Superfluid’s streaming functionality to NFTs, allowing for a user to “mint a continuous supply of NFTs”. This stream of NFTs can then be sold via auctions. Another interesting part of the emanator app is that these NFTs are for creators, artists 👩‍🎨 , or musicians 🎼 . 

There are a lot more technical details about how this application works, like the use of a Superfluid Instant Distribution Agreement (IDA), revenue split per auction, auction process, and the smart contract itself; however, since this is a “how-to” and not a “how does […]” tutorial, I’ll leave you with a link to the README.md of the original Emanator `monorepo`, if you want to learn more.  

Finally, let’s get to some code!

Setup

1. Download the repo from redwood-eth-with-fauna

Git clone the redwood-eth-with-fauna repo on your terminal, favorite text editor, or IDE. For greater cognitive ease, I’ll be using VSCode for this tutorial.

2. Install app dependencies and setup environment variables 🔐

To install this project’s dependencies after you’ve cloned the repo, just run:

yarn

…at the root of the directory. Then, we need to get our .env file from our .env.example file. To do that run:

cp .env.example .env

In your .env file, you still need to provide INFURA_ENDPOINT_KEY. Contrary to what you might initially think, this variable is actually your PROJECT ID of your Infura app. 

If you don’t have an Infura account, you can create one for free! 🆓 🕺

An example view of the Infura dashboard for my redwood-eth-with-fauna app. Copy the PROJECT ID and paste it in your .env file as for INFURA_ENDPOINT_KEY

3. Update the GraphQL schema and run the database migration

In the schema file found by at:

api/prisma/schema.prisma 

…we need to add a field to the Auction model. This is due to a bug in the code where this field is actually missing from the monorepo. So, we must add it to get our app working!

We are adding line 33, a contentHash field with the type `String` so that our Auctions can be added to our database and then shown to the user.

After that, we need to run a database migration using a Redwood.js command that will automatically update some of our project’s code. (How generous of the Redwood devs to abstract this responsibility from us; this command just works!) To do that, run:

yarn rw db save redwood-eth-with-fauna && yarn rw db up

You should see something like the following if this process was successful.

At this point, you could start the app by running

yarn rw dev

…and create, and then mint your first NFT! 🎉 🎉 

Note: You may get the following error when minting a new NFT:

If you do, just refresh the page to see your new NFT on the right!

You can also click on the name of your new NFT to view it’s auction details like the one shown below:

You can also notice on your terminal that Redwood updates the API resolver when you navigate to this page.

That’s all for the setup! Unfortunately, I won’t be touching on how to use this part of the UI, but you’re welcome to visit Emanator’s monorepo to learn more.

Now, we want to add Fauna to our app.

Adding Fauna

Before we get to adding Fauna to our Redwood app, let’s make sure to power it down by pressing CTL+C (on macOS). Redwood handles hot reloading for us and will automatically re-render pages as we make edits which can get quite annoying while we make your adjustments. So, we’ll keep our app down for now until we’ve finished adding Fauna. 

Next, we want to make sure we have a Fauna secret API key from a Fauna database that we create on Fauna’s dashboard (I will not walk through how to do that, but this helpful article does a good job of covering it!). Once you have copied your key secret, paste it into your .env file by replacing <FAUNA_SECRET_KEY>:

Make sure to leave the quotation marks in place! 

Importing GraphQL Schema to Fauna

To import our GraphQL schema of our project to Fauna, we need to first schema stitch our 3 separate schemas together, a process we’ll do manually. Make a new file api/src/graphql/fauna-schema-to-import.gql. In this file, we will add the following:

type Query {
 bids: [Bid!]!
  auctions: [Auction!]!
 auction(address: String!): Auction
  web3Auction(address: String!): Web3Auction!
 web3User(address: String!, auctionAddress: String!): Web3User!
}
 
# ------ Auction schema ------
type Auction {
 id: Int!
 owner: String!
 address: String!
 name: String!
 winLength: Int!
 description: String
 contentHash: String
 createdAt: String!
 status: String!
 highBid: Int!
 generation: Int!
 revenue: Int!
 bids: [Bid]!
}
 
input CreateAuctionInput {
 address: String!
 name: String!
 owner: String!
 winLength: Int!
 description: String!
 contentHash: String!
 status: String
 highBid: Int
 generation: Int
}
 
# Comment out to bypass Fauna `Import your GraphQL schema' error
# type Mutation {
#   createAuction(input: CreateAuctionInput!): Auction
# }

# ------ Bids ------
type Bid {
 id: Int!
 amount: Int!
 auction: Auction!
 auctionAddress: String!
}
 
 
input CreateBidInput {
 amount: Int!
 auctionAddress: String!
}
 
input UpdateBidInput {
 amount: Int
 auctionAddress: String
}
 
# ------ Web3 ------
type Web3Auction {
 address: String!
 highBidder: String!
 status: String!
 highBid: Int!
 currentGeneration: Int!
 auctionBalance: Int!
 endTime: String!
 lastBidTime: String!
 # Unfortunately, the Fauna GraphQL API does not support custom scalars.
 # So, we'll this field from the app.
 # pastAuctions: JSON!
 revenue: Int!
}
 
type Web3User {
 address: String!
 auctionAddress: String!
 superTokenBalance: String!
 isSubscribed: Boolean!
}

Using this schema, we can now import it to our Fauna database.

Also, don’t forget to make the necessary changes to our 3 separate schema files api/src/graphql/auctions.sdl.js, api/src/graphql/bids.sdl.js, and api/src/graphql/web3.sdl.js to correspond to our new Fauna GraphQL schema!! This is important to maintain consistency between our app’s GraphQL schema and Fauna’s.

View Complete Project Diffs — Quick Start section

If you want to take a deep dive and learn the necessary changes required to get this project up and running, great! Head on to the next section!!  

Otherwise, if you want to just get up and running quickly, this section is for you. 

You can git checkout the `integrating-fauna` branch at the root directory of this project’s repo. To do that, run the following command:

git checkout integrating-fauna

Then, run yarn again, for a sanity check:

yarn

To start the app, you can then run:

yarn rw dev

Steps to add Fauna

Now for some more steps to get our project going!

1. Install faunadb and graphql-request

First, let’s install the Fauna JavaScript driver faunadb and the graphql-request. We will use both of these for our main modifications to our database scripts folder to add Fauna. 

To install, run:

yarn workspace api add faunadb graphql-request

2. Edit  api/src/lib/db.js and api/src/functions/graphql.js

Now, we will replace the PrismaClient instance in api/src/lib/db.js with our Fauna instance. You can delete everything in file and replace it with the following:

Then, we must make a small update to our api/src/functions/graphql.js file like so:

3. Create api/src/lib/fauna-client.js

In this simple file, we will instantiate our client-side instance of the Fauna database with two variables which we will be using in the next step. This file should end up looking like the following:

4. Update our first service under api/src/services/auctions/auctions.js

Here comes the hard part. In order to get our services running, we need to replace all Prisma related commands with commands using an instance of the Fauna client from our fauna-client.js we just created. This part doesn’t seem straightforward initially, but with some deep thought and thinking, all the necessary changes come down to understanding how Fauna’s FQL commands work. 

FQL (Fauna Query Language) is Fauna’s native API for querying Fauna. Since FQL is expression-oriented, using it is as simple as chaining several functional commands. Thus, for the first changes in api/services/auctions/auctions.js, we’ll do the following:

To break this down a bit, first, we import the client variables and `db` instance from the proper project file paths. Then, we remove line 11, and replace it with lines 13 – 28 (you can ignore the comments for now, but if you really want to see the rest of these, you can check out the integrating-fauna branch from this project’s repo to see the complete diffs). Here, all we’re doing is using FQL to query the auctions Index of our Fauna Indexes to get all the auctions data from our Fauna database. You can test this out by running console.log(auctionsRaw).

From running that console.log(), we see that we need to do some object destructing to get the data we need to update what was previously line 18:

const auctions = await auctionsRaw.map(async (auction, i) => {

Since we dealing with an object, but we want an array, we’ll add the following in the next line after finishing the declaration of const auctionsRaw:

Now we can see that we’re getting the right data format.

Next, let’s update the call instance of `auctionsRaw` to our new auctionsDataObjects:

Here comes the most challenging part of updating this file. We want to update the simple return statement of both the auction and createAuction functions. Actually, the changes we make are actually quite similar. So, let’s make update our auction function like so:

Again, you can ignore the comments, as this comment is just to note the preference return command statement that was there prior to our changes.

All this query says is, “in the auction Collection, find one specific auction that has this address.”

This next step to complete this createAuctin function is admittedly quite hacky. While making this tutorial, I realized that Fauna’s GraphQL API unfortunately does not support custom scalars (you can read more about that under the Limitations section of their GraphQL documentation). This sadly meant that the GraphQL schema of Emanator’s monorepo would not work directly out of the box. In the end, this resulted in having to make many minor changes to get the app to properly run the creation of an auction. So, instead of walking in detail through this section, I will first show you the diff, then briefly summarize the purpose of the changes. 

Looking at the green lines of 100 and 101, we can see that the functional commands we’re using here are not that much different; here, we’re just creating a new document in our Auction collection, instead of reading from the Indexes. 

Turning back to the data fields of this createAuction function, we can see that we are given an input as argument, which actually refers to the UI input fields of the new NFT auction form on the Home page. Thus, input is an object of six fields, namely address, name, owner, winLength, description, and contentHash. However, the other four fields that are required to fulfill our GraphQL schema for an Auction type are still missing! Therefore, the other variables I created, id, dateTime, status, and highBid are variables I, more or less, hardcoded so that this function could complete successfully. 

Lastly, we need to complete the export of the Auction constant. To do that, we’ll make use of the Fauna client once more to make the following changes:

And, we’re finally done with our first service 🎊 , phew!

Completing GraphQL services

By now, you may be feeling a bit tired from these changes from updating the GraphQL services (I know I was while I was trying to learn the necessary changes to make!). So, to save you time getting this app to work, I’ll instead of walking through them entirely, I will share the git diffs again from the integrating-fauna branch that I have already working in the repo. After sharing them, I will summarize the changes that were made.

First file to update is api/src/services/bids/bids.js:

And, updating our last GraphQL service:

Finally, one final change in web/src/components/AuctionCell/AuctionCell.js:

So, back to Fauna not supporting custom scalars. Since Fauna doesn’t support custom scalars, we had to comment out the pastAuctions field from our web3.js service query (along with commenting it out from our GraphQL schemas). 

The last change that was made in web/src/components/AuctionCell/AuctionCell.js is another hacky change to make the newly created NFT address domains (you can navigate to these when you click on the hyperlink of the NFT name, located on the right of the home page after you create a new NFT) clickable without throwing an error. 😄 

Conclusion

Finally, when you run:

yarn rw dev

…and you create a new token, you can now do so using Fauna!! 🎉🎉🎉🎉

Final notes

There are two caveats. First, you will see this annoying error message appear above the create NFT form after you have created one and confirmed the transaction with MetaMask.

Unfortunately, I couldn’t find a solution for this besides refreshing the page. So, we will do this just like we did with our original Emanator monorepo version. 

But when you do refresh the page, you should see your new shiny token displayed on the right! 👏 

 And, this is with the NFT token data fetched from Fauna! 🙌 🕺 🙌🙌

The second caveat is that the page for a new NFT is still not renderable due to the bug web/src/components/AuctionCell/AuctionCell.js.

This is another issue I couldn’t solve. However, this is where you, the community, can step in! This repo, redwood-eth-with-fauna is openly available on GitHub, along with the (currently) finalized integrating-fauna branch that has a working (as it currently does 😅) version of the Emanator app. So, if you’re really interested in this app and would like to explore how to leverage this app further with Fauna, feel free to fork the project and explore or make changes! I can always be reached on GitHub and am always happy to help you! 😊

That’s all for this tut, and I hope you enjoyed! Feel free to reach out with any questions on GitHub!



Source link

r/webdev - No one can replicate my issue except my fiance. Is our wifi hacked or is it an issue with my site?
Strategy

No one can replicate my issue except my fiance. Is our wifi …


Hi, I am working as a contractor for a company who owns several websites.

One of the websites they own is www.SafetyStoreFronts.com

The also own SafetyStoreFront.com (without an S at the end) but that one is not having an issue. And about 30-50 other URLs which are not having issues.

For me and my fiance, in the URL bar it shows SafetyStoreFronts.com – fine I guess…. But it’s not even supposed to do that – it’s supposed to redirect to www.GraceSafetyStore.com

For everyone else in the world, it is doing exactly that.

People be acting like I’m crazy.

I’ve worked about 12 hours today – mostly trying to figure this out.

I’ve contacted both my domain and host multiple times.

I have used incognito in chrome, I have cleared cache, I have restarted. I have hardwired into my router, I have used my cellular service without wifi. I have used Safari, I have used Chrome, I have even used Edge even though I hate it.

Everytime I see the website content of http://regentxmedical.com/ which I should not see – I have no idea who or what they are. Not affiliated with me or my bosses company.

My fiance just walked in the door 10 minutes ago and I asked him to type it into his android phone and he is legit getting the exact same website content displayed but with the “correct” url.

It also says it’s not secure, even though it is secure.

I ran it through Securi site check or however it’s spelled and it gave me a TLS error that the domain doesn’t match. It discovered that the wrong security certificate is installed for this website on this server.

Does anyone else see this?

If so how can I fix this?

If not then why do both my fiance and I see this no matter what devices we use or what we try to do?

r/webdev - No one can replicate my issue except my fiance. Is our wifi hacked or is it an issue with my site?
r/webdev - No one can replicate my issue except my fiance. Is our wifi hacked or is it an issue with my site?
r/webdev - No one can replicate my issue except my fiance. Is our wifi hacked or is it an issue with my site?



Source link

Proper Tabbing to Interactive Elements in Firefox on macOS
Strategy

Proper Tabbing to Interactive Elements in Firefox on macOS


I just had to debug an issue with focusable elements in Firefox. Someone reported to me that when tabbing to a certain element within a CodePen embed, it shot the scroll position to the top of the page (WTF?!). So, I went to go debug the problem by tabbing through an example page in Firefox, and this is what I saw:


I didn’t even know what to make of that. It was like some elements you could tab to but not others? You can tab to <button>s but not <a>s? Uhhhhh, that doesn’t seem right that you can’t tab to links in Firefox?

After searching and asking around, it turns out it’s this preference at the OS level on macOS.

System Preferences > Keyboard > Shortcuts > User keyboard navigation to move focus between controls

If you have to turn that on, you also have to restart Firefox. Once you have, then you can tab to things you’d expect to be able to tab to, like links.

About that bug with the scrolling to the top of the page. See that “Skip Results Iframe” link that shows up when tabbing through the CodePen Embed? It only shows up when :focus-ed (as the point of it is to skip over the <iframe> rather than being forced to tab through it). I “hid” it by doing a position: absolute; top: -9999px; left: -9999px thing (old muscle memory), then removing those values when in focus. For some reason, when tabbed to, Firefox would see those values and instantly jump the page up, even though the focus style moved it back into a normal place. Must have been some kind of race condition thing.

I also found it very silly that Firefox would do that to the parent page when that link was inside an iframe. I fixed it up using a more vetted accessible hiding technique.



Source link