This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Hide... */ | |
| /* Views on list tweets */ | |
| [data-testid="tweet"][tabindex="0"] div[id^=id__][role=group] > div:nth-child(4):nth-last-child(2), | |
| /* Views on focused tweet */ | |
| [data-testid="tweet"][tabindex="-1"] div[dir] + div[aria-hidden="true"]:nth-child(2):nth-last-child(2), | |
| [data-testid="tweet"][tabindex="-1"] div[dir] + div[aria-hidden="true"]:nth-child(2):nth-last-child(2) + div[dir]:last-child, | |
| /* Bookmark button on focused tweet */ | |
| [data-testid="tweet"][tabindex="-1"] div[id^=id__][role=group] > div:nth-child(4):nth-last-child(2), | |
| /* Share button on all tweets */ | |
| div[id^=id__][role=group] > div:nth-child(5):last-child, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| entities = $('#react-root')._reactRootContainer._internalRoot?.current?.memoizedState?.element?.props?.children?.props?.store?.getState()?.entities?.users?.entities | |
| users = {} | |
| for (let user of Object.values(entities)) { | |
| users[user.screen_name] = user | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Nav item */ | |
| a[title="Shorts"], | |
| /* Video shelf in Home and Subscriptions */ | |
| ytd-rich-shelf-renderer[is-shorts], | |
| /* Video shelf in Search */ | |
| ytd-reel-shelf-renderer { | |
| display: none !important; | |
| } | |
| @supports selector(:has(*)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let $segments = document.querySelector('.ytd-transcript-search-panel-renderer #segments-container') | |
| let sections = [] | |
| let parts = [] | |
| for (let $el of $segments.children) { | |
| if ($el.tagName == 'YTD-TRANSCRIPT-SECTION-HEADER-RENDERER') { | |
| if (parts.length > 0) { | |
| sections.push(parts.join(' ')) | |
| parts = [] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function updatePasswords() { | |
| let oldPassword = prompt('Old password:') | |
| if (!oldPassword) return | |
| let loginManager = Components.classes['@mozilla.org/login-manager;1'] | |
| .getService(Components.interfaces.nsILoginManager) | |
| let matchingLogins = loginManager.getAllLogins().filter(l => l.password === oldPassword) | |
| let matchCount = matchingLogins.length | |
| if (matchCount === 0) return alert('No matching logins found') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect } from 'react' | |
| import { useRouter } from 'next/router' | |
| // Current URL is '/' | |
| function Page() { | |
| const router = useRouter() | |
| useEffect(() => { | |
| // Always do navigations after the first render | |
| router.push('/?counter=10', undefined, { shallow: true, scroll: false }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const client_id = process.env.SPOTIFY_CLIENT_ID | |
| const client_secret = process.env.SPOTIFY_CLIENT_SECRET | |
| const authorization_code = Buffer.from(`${client_id}:${client_secret}`).toString('base64') | |
| const getAccessToken = async (refresh_token: string) => { | |
| const response = await fetch(`https://accounts.spotify.com/api/token`, { | |
| method: 'POST', | |
| headers: { | |
| Authorization: authorization_code, | |
| 'Content-Type': 'application/x-www-form-urlencoded' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const refreshTokens = async () => { | |
| try { | |
| const credentials = await getSpotifyCredentials() //we wrote this function above | |
| const credsB64 = btoa(`${credentials.clientId}:${credentials.clientSecret}`); | |
| const refreshToken = await getUserData('refreshToken'); | |
| const response = await fetch('https://accounts.spotify.com/api/token', { | |
| method: 'POST', | |
| headers: { | |
| Authorization: `Basic ${credsB64}`, | |
| 'Content-Type': 'application/x-www-form-urlencoded', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Spotify Currently Playing | |
| * 28/03/2023 | |
| **/ | |
| const clientId = "CLIENT_ID", | |
| clientSecret = "CLIENT_SECRET", | |
| refresh_token = "REFRESH_TOKEN", | |
| TOKEN_ENDPOINT = "https://accounts.spotify.com/api/token"; |