Skip to content

Instantly share code, notes, and snippets.

View stayallive's full-sized avatar
🕶️
"Never send a human to do a machine's job."

Alex Bouma stayallive

🕶️
"Never send a human to do a machine's job."
View GitHub Profile
@stayallive
stayallive / README.md
Last active November 8, 2023 16:57
Cloudflare worker Sentry tunnel

Tunnel events through a Cloudflare Worker

This example shows how you can use a Cloudflare Worker to proxy events to Sentry from any SDK but most useful for the tunnel option in the JavaScript SDK.

To deploy this example:

  1. Create a new Cloudflare Worker from your Cloudflare dashboard
  2. Replace the example worker code with the contents of the worker.js file
  3. Update the SENTRY_DSN_WHITELIST and/or SENTRY_HOST_WHITELIST with all the DSN's or hosts that are allowed to be proxied
  4. (optional) Update PROXY_PATHNAME with the path you want the proxy to operate on, be careful to not use "sentry" or another keyword here that might trigger an adblocker, keep it simple
@stayallive
stayallive / README.md
Created March 22, 2023 11:14
Closure alternative for Sentry options in Laravel config

Using closures in Laravel config files doesn't jive with php artisan config:cache but there is an easy alternative.

Consider the following code in your config/sentry.php:

'before_send_transaction' => function (
    \Sentry\Event $transaction
): ?\Sentry\Event {
    $ignore = ['_debugbar', 'monitoring', 'pleaseignoreme'];
    $request = $transaction->getRequest();
@stayallive
stayallive / keybase.md
Created September 17, 2014 21:18
Keybase

Keybase proof

I hereby claim:

  • I am stayallive on github.
  • I am stayallive (https://keybase.io/stayallive) on keybase.
  • I have a public key whose fingerprint is E2A8 4016 58D1 6621 2FA5 6FA9 B2E4 9FA1 09DF 99AD

To claim this, I am signing this object:

@stayallive
stayallive / install.sh
Last active February 10, 2022 09:36
Install PHP 5.4.39 on Plesk 11.5 & 12 (CentOS 6)
#!/bin/bash
# Make sure you are up to date
yum -y update && yum -y install wget
# Install EPEL repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Get us a clean working directory
mkdir /php
@stayallive
stayallive / install.sh
Last active May 4, 2018 19:59
Install PHP 5.6.7 on Plesk 11.5 & 12 (CentOS 6)
#!/bin/bash
# Make sure you are up to date
yum -y update && yum -y install wget
# Install EPEL repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Get us a clean working directory
mkdir /php
@stayallive
stayallive / install.sh
Last active September 20, 2022 17:24
Install PHP 5.5.23 on Plesk 11.5 and 12 (CentOS 6)
#!/bin/bash
# Make sure you are up to date
yum -y update && yum -y install wget
# Install EPEL repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Get us a clean working directory
mkdir /php