Skip to content

Instantly share code, notes, and snippets.

@lek890
lek890 / gist:be33feee53f19915787e586613871387
Created November 9, 2023 09:14
Solution - local DNS resolution issues in chrome - local domains in /etc/hosts not working
- Enter the host name and clear them in chrome://net-internals/#dns edge://net-internals/#dns
- Enter and clear hostname, localhost in chrome://net-internals/#hsts edge://net-internals/#hsts
- Go to site settings by clicking on the info icon next to the url in the browser and allow any content that is applicable for you and is being blocked (esp secure content area)
- Go to cookie settings and clear cookies and cache for the site
https://free-for.dev/
https://untools.co/
git fetch origin # Updates origin/master
git rebase origin/master # Rebases current branch onto origin/master
import React from "react";
import Controls from "./Controls";
const tracks = [
"bensound-acousticbreeze.mp3",
"https://rss.art19.com/episodes/f806adfc-e38a-45ae-8816-ab94beaa7dd1.mp3?rss_browser=BAhJIglGWUVPBjoGRVQ%3D–b8c3f2cb22145d5584957642b8314a01f09a8949"
];
function App(props) {
const [track, setTrack] = React.useState(tracks[0]);
<Controls
togglePlaying={togglePlaying}
startOver={startOver}
skipToEnd={skipToEnd}
rewindTrack={rewindTrack}
forwardTrack={forwardTrack}
increasePlayBackRate={increasePlayBackRate}
adjustVolume={adjustVolume}
playSomething={playSomething}
/>
const onSeek = (value) => {
if (audioRef?.current) {
clearInterval(intervalRef.current);
audioRef.current.currentTime = value;
setProgress(audioRef.current.currentTime);
}
};
<input
type="range"
value={progress}
step="1"
min="0"
max={duration ? duration : `${duration}`}
className="progress"
onChange={(e) => onSeek(e.target.value)}
onMouseUp={onSeekEnd}
onKeyUp={onSeekEnd}
import { render } from "@testing-library/react";
import { UserProfile } from "./User";
it("doesn't shows the premium features", () => {
const { queryByTestId } = render(
<UserProfile user={{ name: "Sheldon", isPremiumUser: false }} />
);
expect(queryByTestId("premiumFeatures")).toBeFalsy(); //passes
});
import { render } from "@testing-library/react";
import { UserProfile } from "./User";
it("doesn't show the premium features", () => {
const { getByTestId } = render(
<UserProfile user={{ name: "Sheldon", isPremiumUser: false }} />
);
expect(getByTestId("premiumFeatures")).toBeTruthy(); //throws
});
import { render } from "@testing-library/react";
import { UserProfile } from "./User";
it("shows the premium features", () => {
const { getByTestId } = render(
<UserProfile user={{ name: "Sheldon", isPremiumUser: true }} />
);
expect(getByTestId("premiumFeatures")).toBeTruthy(); //passes
});