Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/** | |
* @example | |
* getDOMChangelog() | |
* | |
* at https://github.githubassets.com/assets/vendor-cd663c13.js:120:53592 | |
* at https://github.githubassets.com/assets/vendor-cd663c13.js:120:53557 | |
* at cn (https://github.githubassets.com/assets/frameworks-728fb339.js:1:78638) | |
* at on (https://github.githubassets.com/assets/frameworks-728fb339.js:1:77982) | |
* at https://github.githubassets.com/assets/github-bootstrap-59211cb2.js:16:285146 | |
* at https://github.githubassets.com/assets/github-bootstrap-59211cb2.js:1:15524 |
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 { reverse } = require('dns') | |
const check = ip => new Promise( | |
(resolve, reject) => | |
addresses.includes(ip) || reverse( | |
ip, | |
(error, hostnames) => error | |
? reject(error) | |
: resolve( | |
hostnames.some( |
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 load_nvm { | |
source "$NVM_DIR/nvm.sh" | |
if [[ ! -f "$HOME/dotfiles/.npm_completion.sh" ]]; then | |
npm completion >> ~/dotfiles/.npm_completion.sh | |
fi | |
source ~/dotfiles/.npm_completion.sh | |
} | |
if [ -f ".nvmrc" ]; then | |
# Load NVM if needed |
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 providers = [ | |
['googletagmanager.com', 'googletagmanager'], | |
['linkedin.com', 'linkedin'], | |
['d2c7xlmseob604.cloudfront.net', 'smartling'], | |
['d2fltix0v2e0sb.cloudfront.net', 'dev.to'], | |
]; | |
/** | |
* Get the name of the script provider where applicable | |
* @param {string} url |
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 request_metadata = { | |
user_agent: request.get('user-agent'), | |
ip: request.get('true-client-ip'), // provided by DNS service | |
country: request.get('cf-ipcountry'), // Cloudflare provides GeoIP for free! | |
is_known_crawler: isbot(request.get('user-agent')), | |
referrer: request.get('referer'), | |
}; |
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 { code, details } = error; | |
Object.assign(record, { code, details }); | |
... | |
sendError(record); |
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
async function userRefreshInbox({ username }) { | |
try { | |
const response = await getNewInboxItems(); | |
// Do the thing you are supposed to do | |
} catch (error) { | |
error.code = 'SOME_ELABORATE_FLOW'; | |
error.details = { | |
username, | |
flow: 'User refresh inbox', | |
}; |
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
record.metadata = { | |
url: document.location.href, | |
referrer: document.referrer, | |
cookie: navigator.cookieEnabled ? document.cookie : 'disabled', | |
language: navigator.language, | |
connection: navigator.connection.effectiveType, | |
hasFocus: document.hasFocus(), | |
readyState: document.readyState, | |
secondsIn: Math.round(performance.now() / 1000), // page age in seconds |
NewerOlder