- Add the
worker.js
code to a new Cloudflare Worker - Set up a worker for your domain than responds to
/tunnel/*
and point it to your new worker - Add the Sentry script to your html but replace
https://browser.sentry-cdn.com/
with./tunnel/
- Eg.
<script src="./tunnel/6.9.0/bundle.min.js"></script>
- Eg.
init
Sentry with thetunnel
option set to/tunnel/
- Eg.
Sentry.init({ dsn: "__DSN__", tunnel: "/tunnel/" })
- Eg.
- Rejoice at how everything now works with ad blockers
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
/** | |
* Steps to use: | |
* 1. Create CF Worker, copy and paste this in | |
* 2. (Optional) Update configuration defaults | |
* - If you want to manage in code, do so below under "Static Configuration" | |
* - If you want dynamic custom config: Create CFW KV namespace, link them, and add reference below | |
* | |
* - You can overwrite default path prefix for loading analytics.js (<yourdomain>/ajs) | |
* (corresponding KV entry: `script_path_prefix`) | |
* - You can overwrite default path prefix for handling first-party data collection (<yourdomain>/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
// To get started, make sure you're using the latest version of the analytics.js snippet (4.1.0 or above) | |
// and remove the `analytics.load("YOUR_WRITE_KEY")` call. then drop this script below the snippet. | |
// this is a standalone script for modern browsers. if you'd like to target older browsers, include | |
// a fetch polyfill and use that instead of window.fetch. This would require that you build and package the | |
// script somehow (rollup, webpack, browserify, etc). You may also want to transpile it to ES5 w eg Babel. | |
// This script is configured to make all collection opt-in (rather than opt-out) for all users. | |
// If you want to conditionally require whether or not to block data collection before affirmative consent, use something | |
// like inEU below and pass that function into `conditionallyLoadAnalytics`. If you want to collect data until the user |
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 | |
$image = new JImage('/path/to/original.jpg'); | |
$height = $image->getHeight(); | |
$width = $image->getWidth(); | |
if ($height > $width) { | |
$crop_square = $width; | |
$crop_top = ($height - $width) / 2; |