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 mem from "mem"; | |
const ELEMENT_STYLE_CACHE_TIME = 3000; | |
let __memoizedGetElementStyle; | |
export function getElementOffset(target) { | |
__memoizedGetElementStyle = __memoizedGetElementStyle || mem(getElementStyle, { maxAge: ELEMENT_STYLE_CACHE_TIME }); | |
const boundingRect = target.getBoundingClientRect(); | |
const bodyStyle = __memoizedGetElementStyle(document.body); |
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 fetch = require("node-fetch"); | |
const chalk = require("chalk"); | |
const prettyMs = require("pretty-ms"); | |
const VError = require("verror"); | |
const pruddy = require("pruddy-error"); | |
const API = "https://api-zcash.flypool.org"; | |
const DELAY = 60; | |
const MINER = "t1R21Uq3HQRiyj6ff1kFQcPusqPXiBaAc2U"; | |
//const PAYOUT_MIN = 0.03; |
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 { Service } = require("vulpes"); | |
// Create a new service | |
const service = new Service(); // Service takes an optional storage parameter | |
// Initialise the service | |
await service.initialise(); |
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 { applyMiddleware, createStore } from "redux"; | |
import { createSyncMiddleware, syncStore } from "redux-browser-extension-sync/background"; | |
import rootReducer from "../reducers/index.js"; | |
const syncMiddleware = createSyncMiddleware(); | |
const store = syncStore(createStore( | |
rootReducer, | |
applyMiddleware(syncMiddleware) | |
)); |
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 { applyMiddleware, createStore } from "redux"; | |
import { createSyncMiddleware, syncStore } from "redux-browser-extension-sync"; | |
import rootReducer from "../reducers/index.js"; | |
const syncMiddleware = createSyncMiddleware(); | |
const store = syncStore(createStore( | |
rootReducer, | |
applyMiddleware(syncMiddleware) | |
)); |
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
console.log( | |
"%c Excellent ", | |
[ | |
"background-color: #663dff", | |
"background-image: linear-gradient(319deg, #663dff 0%, #aa00ff 37%, #cc4499 100%)", | |
"padding: 8px", | |
"font-weight: bold", | |
"color: #FFF", | |
"font-family: Arial", | |
"font-size: 28px", |
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
console.log( | |
"%cabc%cdef", | |
"background-color: #000; color: #99F; font-weight: bold; padding: 2px", | |
"background-color: #99F; color: #000; font-style: italic; padding: 2px" | |
); |
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 { pbkdf2: deriveKey } = require("pbkdf2"); | |
const HMAC_KEY_SIZE = 32; | |
const PASSWORD_KEY_SIZE = 32; | |
function pbkdf2(password, salt, rounds, bits) { | |
return new Promise((resolve, reject) => { | |
deriveKey(password, salt, rounds, bits / 8, "sha256", (err, key) => { | |
if (err) { | |
return reject(err); |
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
# Sample publisher ads.txt | |
somenetwork.com, 1234, DIRECT | |
another.org, 4455abc, RESELLER | |
# !include https://managednetwork.com/managed.ads.txt.php?id=123 |
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 crypto = require("crypto"); | |
const DERIVATION_ROUNDS = 200000; | |
function constantTimeCompare(val1, val2) { | |
let sentinel; | |
if (val1.length !== val2.length) { | |
return false; | |
} | |
for (let i = 0; i <= val1.length - 1; i += 1) { |