Skip to content

Instantly share code, notes, and snippets.

View mcsolha's full-sized avatar
🎯
Focusing

Matheus Solha mcsolha

🎯
Focusing
View GitHub Profile
@mcsolha
mcsolha / new-relic-browser.d.ts
Last active February 6, 2024 13:07
new-relic-browser global typing
/**
* Ensure the browser agent is present on every page you want to monitor!
*
* Refs:
* https://forum.newrelic.com/s/hubtopic/aAX8W0000008eQTWAY/how-to-import-newrelic-for-react-app-on-typescript
* https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/
* https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-d-ts.html
*
* Steps:
* Enable browser agent on the page to be monitored
function onHold(el, cb) {
let interval;
el.addEventListener('mousedown', () => interval = setInterval(() => requestAnimationFrame(cb), 10));
el.addEventListener('mouseup', () => clearInterval(interval));
el.addEventListener('mouseleave', () => clearInterval(interval));
}
function onHold(el, cb) {
let interval;
el.addEventListener('mousedown', () => interval = setInterval(() => requestAnimationFrame(cb), 10));
el.addEventListener('mouseup', () => clearInterval(interval));
el.addEventListener('mouseleave', () => clearInterval(interval));
}
@mcsolha
mcsolha / update_vscode
Created February 19, 2018 13:48
Update VSCode - Ubuntu 16.04
wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb