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
#!/usr/bin/env bash | |
declare -i last_called=0 | |
declare -i throttle_by=2 | |
@throttle() { | |
local -i now=$(date +%s) | |
if (($now - $last_called >= $throttle_by)) | |
then | |
"$@" |
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
#!/usr/bin/env bash | |
# Taken from: https://akrabat.com/prevent-an-external-drive-from-auto-mounting-on-macos/ | |
# Usage: ./no_automount My\ Disk | |
NAME=$1 | |
if [ -z "$NAME" ] ; then | |
echo "Usage: no_automount {Disk Name}" | |
exit 1 |
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 | |
// source: http://www.paulferrett.com/2009/php-camel-case-functions/ | |
/** | |
* Translates a camel case string into a string with underscores (e.g. firstName -> first_name) | |
* @param string $str String in camel case format | |
* @return string $str Translated into underscore format | |
*/ | |
function from_camel_case($str) { | |
$str[0] = strtolower($str[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
it('mocks the rocket launches once', () => { | |
// the `laika` variable below can come either from the global instance, when running in the browser | |
// or in case of unit tests, it might be a link we've set up in a `beforeAll` of this test suite | |
const interceptor = laika.intercept({ operationName: 'ListMissions' }) | |
interceptor.mockResultOnce({ | |
result: { | |
data: { | |
launchesPast: [ | |
{ mission_name: 'Sputnik 2', launch_site: { site_name_long: 'Baikonur 1/5' } }, |
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 type {Laika, InterceptApi} from '@zendesk/laika' | |
describe('My suite', () => { | |
let laika: Laika | |
before(() => { | |
cy.visit('/') | |
cy.window() | |
.its('laika') | |
.then((instance) => { |
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 { createLazyLoadableLaikaLink } from '@zendesk/laika' | |
const conditionalLinks = window.Cypress | |
? [createLazyLoadableLaikaLink({ clientName: 'my-graph' }) | |
: [] | |
const apolloClient = new ApolloClient({ | |
link: ApolloLink.from([ | |
...conditionalLinks, | |
new HttpLink({ uri: 'https://api.example.com/graphql' }), |
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
diff --git a/lighthouse-core/config/constants.js b/lighthouse-core/config/constants.js | |
index 264402bb026484a293a9efac60405c52eb8f525b..4aa5098162b70d83ed4ba6c630894ebaf27908a9 100644 | |
--- a/lighthouse-core/config/constants.js | |
+++ b/lighthouse-core/config/constants.js | |
@@ -114,6 +114,7 @@ const defaultSettings = { | |
budgets: null, | |
locale: 'en-US', // actual default determined by Config using lib/i18n | |
blockedUrlPatterns: null, | |
+ networkIdleIgnoredUrlPatterns: null, | |
additionalTraceCategories: null, |
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
<template> | |
<!-- Simple usage: --> | |
<h1>message: ${async(message).value}</h1> | |
<!-- With a placeholder: --> | |
<h1>message: ${async(message).value ? async(message).value : '...'}</h1> | |
</template> |
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
// many based/copied from https://github.com/tycho01/typical/tree/master/src | |
// utility types: | |
type False = "0"; | |
type True = "1"; | |
type Bool = True | False; | |
type If<Cond extends Bool, Then, Else> = { 1: Then; 0: Else }[Cond]; | |
type WrapInPromiseIfTrue<T, IsAsync extends Bool> = If< | |
IsAsync, | |
Promise<T>, |
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
/* ==UserStyle== | |
@name Remove top gradient in Google Photos - 09/07/2019, 22:08:26 | |
@namespace github.com/niieani | |
@version 1.0.0 | |
@description Removes the annoying top gradient in the Google Photos views: full screen photo, album | |
@author Bazyli Brzóska | |
==/UserStyle== */ | |
@-moz-document domain("photos.google.com") { | |
.KYCEmd { | |
background-image: none; |
NewerOlder