<template>
<!--
When isLoading is true, the <div> is in the DOM, the <p> is not.
When isLoading is false, Vue will remove the <div> and add the <p> to the DOM,
at which point <MyComponent> will be created and passed the fetched data.
-->
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
license: gpl-3.0 | |
height: 700 |
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
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
annotations: | |
helm.sh/hook: crd-install | |
creationTimestamp: "2019-06-04T20:20:40Z" | |
generation: 1 | |
name: federatedsecrets.types.kubefed.k8s.io | |
resourceVersion: "5492" | |
selfLink: /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/federatedsecrets.types.kubefed.k8s.io |
In real code, you would call makePromise().then()
or await makePromise()
. I assigned the promise to an intermediate variable to illustrate the difference. Which style do you prefer?
const cl = console.log
function thenCatch () {
cl('start')
const promise = makePromise()
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
// https://developer.mozilla.org/en-US/docs/Web/API/Storage | |
// Wraps all methods in a try/catch. | |
// Useful for non-critical storage, and when swallowing errors is acceptable. | |
// Reasons why localStorage might fail: | |
// * Simply referencing window.localStorage when in a 3rd party iframe. (brave & safari) | |
// * localStorage can be null | |
// * Storage quota exceeded | |
const methods = ['key', 'getItem', 'setItem', 'removeItem', 'clear'] | |
const idgafLocalStorage = {} |
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
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
// Modified from https://github.com/wmcmurray/just-detect-adblock | |
// Detects: uBlock, Adblock, Adblock Plus, AdBlocker Ultimate, Ghostery, | |
export async function isAdblockDetected () { | |
let detected = false | |
// create the bait | |
const bait = document.createElement('div') |
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
package main | |
import ( | |
"crypto/tls" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
_ "io/ioutil" | |
"math/rand" | |
"net/http" |
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
// ==UserScript== | |
// @name Set Kucoin Trading View Time Period | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.kucoin.com/trade/* | |
// @exclude https://www.kucoin.com/trade/charting_library* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=kucoin.com | |
// @grant none |
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
const res = await stripe.subscriptions.update(subscriptions[0].id, { | |
default_payment_method: paymentMethods[0].id, | |
billing_cycle_anchor: 'unchanged', | |
proration_behavior:'always_invoice', | |
items: [ | |
...subscriptions[0].items.data.map((item) => ({ | |
id: item.id, | |
deleted: true, | |
clear_usage: | |
item.plan.usage_type === 'metered' ? true : undefined, |