This file contains 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 { Page } from '@playwright/test'; | |
export async function waitForGraphQL( | |
page: Page, | |
operationName: string | |
): Promise<void> { | |
await page.waitForResponse(async (response) => { | |
if (response.url().endsWith('/graphql')) { | |
const responseText = await response.text(); | |
const responseData = JSON.parse(responseText); |
This file contains 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
/* | |
Launch Darkly Context Provider using their JavaScript Client SDK | |
This component is used to provide the feature flags context to the rest of the app. | |
This is how you can use feature flags in your components: | |
1) Add your flag to the `Flags` constant in this file if it's not already there: | |
myFlag: { slug: 'my-flag', defaultValue: false }, |
This file contains 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 keepVideoFromSkipping() { | |
// modified from https://stackoverflow.com/a/39754847 | |
function modifyBehavior(video) { | |
var timeTracking = { | |
watchedTime: 0, | |
currentTime: 0 | |
}; | |
var lastUpdated = 'currentTime'; |
This file contains 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
<?php | |
/** | |
* Rewrite blog posts so they start with /blog | |
*/ | |
function change_posts_post_type_args( $args, $post_type ) { | |
if ( $post_type == "post" ) { | |
$args['rewrite'] = array( | |
'slug' => 'blog', |
This file contains 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
<progress value="0"></progress> | |
<style> | |
progress { width: 100%; height: 5px; | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
border: none; | |
background-color: white; | |
color: @green; |
This file contains 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
<script> | |
// Scroll locking | |
var overlayShown = false; | |
var scrollPosition = 0; | |
function toggleScrollLock() { | |
if (!overlayShown) { | |
showOverlay(); | |
} else { |
This file contains 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
.modal, .modal-bg { | |
display: none; | |
} | |
.modal-active .modal-bg { | |
display: block; | |
background-color: rgba(0, 0, 0, 0.7); | |
position: fixed; | |
top: 0; | |
left: 0; |
This file contains 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
# Old format | |
$ ssh-keygen -l -f ~/.ssh/id_rsa.pub | |
# New format | |
$ ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub |
This file contains 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
// AUTO TWEET UNLIKER | |
// | |
// Go to your Twitter profile | |
// Click on the tab for your likes | |
// Open up your JS console | |
// Paste this script in, and hit [return] | |
var scrollDelay = 1000; // milliseconds | |
var scrollAmount = 5; | |
var clickDelay = 600; // milliseconds |
This file contains 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
<?php | |
// Update google map latitude/longitude after importing, using address | |
// | |
// https://support.advancedcustomfields.com/forums/topic/how-to-update-google-map-latitudelongitude-after-importing-using-address/ | |
// https://gist.githubusercontent.com/RadGH/428bd8133c34dae60c0c/raw/fbfb0536abd1afc0fad1d2ed2b51c69304406c78/recalculate-acf-locations.php | |
// | |
// INSTRUCTIONS | |
// 1. Grab the file from this Gist and upload it to your theme. | |
// 2. Configure the options in the variable $ld_recalc. You MUST set the post type, and set the different field keys (see Finding the Field Key). | |
// 3. Call the file at the top of your functions.php script using include "recalculate-acf-locations.php"; |
NewerOlder