Skip to content

Instantly share code, notes, and snippets.

View marcus-sa's full-sized avatar
💭
🏋️‍♂️ + 🥩 + 🥊 + 🔊 + 🖥️ = ❤️

Marcus S. Abildskov marcus-sa

💭
🏋️‍♂️ + 🥩 + 🥊 + 🔊 + 🖥️ = ❤️
View GitHub Profile
@huw
huw / README.md
Last active March 12, 2024 21:32
Remix, Sentry & Cloudflare Workers

How to integrate Remix, Sentry, and Cloudflare Workers (incl. tracing)

The code above is just a sample—I have adapted it from a production codebase and I can't guarantee it will work as-is. It's just here to illustrate what a solution should look like.

The main things you need to do to get everything hooked up are:

  1. Rewrite instrumentBuild to accept a passed-through Hub instance, rather than using getCurrentHub() (including, perniciously, in helper functions such as hasTracingEnabled())
  2. In server/index.ts, create a root transaction from the current route’s name and wrap the loaders and actions in spans via instrumentBuild.
  3. In root.tsx, pass through your tracing & baggage into the meta function.
  4. In root.tsx, include the current domain in tracePropagationTargets (because Remix fetchers will fetch from the entire URL rather than / root, which will confuse Sentry)
  5. (Remix v2) In root.tsx, create an ErrorBoundary component (with the v2_errorBoundary flag set if you're
@ScottMaclure
ScottMaclure / slack_draft_deleter.js
Last active May 9, 2024 14:58
Slack Draft Deleter
// Remove all drafts from your drafts view
// Navigate to drafts
// F12 to raise dev console
// Paste the below
(async function(x) {
for (let e = document.querySelector('[type="trash"]'); e != null; e = document.querySelector('[type="trash"]')) {
e.click();
await new Promise(resolve => setTimeout(resolve, 500))
document.querySelector('[data-qa="drafts_page_draft_delete_confirm"]').click();
await new Promise(resolve => setTimeout(resolve, 1500))
@marcus-sa
marcus-sa / fetch-request-handler.spec.ts
Last active May 24, 2022 10:28
Deepkit HTTP Cloudflare Workers
import { http, JSONResponse, HttpBody, HttpQueries } from '@deepkit/http';
import { entity } from '@deepkit/type';
import { createTestingApp } from '@deepkit/framework';
import { beforeEach, describe } from '@jest/globals';
import { fetchRequestHandler } from '../src';
import { App } from '@deepkit/app';
@entity.name('user')
class User {
@marcus-sa
marcus-sa / client-and-server.spec.ts
Last active May 23, 2022 22:17
Deepkit WebSocket RPC Cloudflare Workers Interconnection
import { createTestingApp } from '@deepkit/framework';
import { ControllerSymbol, rpc } from '@deepkit/rpc';
import { entity } from '@deepkit/type';
import {
webSocketFetchRequestHandler,
CloudflareWorkerRpcWebSocketClient,
} from '../src';
// https://miniflare.dev/testing/jest
@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active May 15, 2024 19:37
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@rainabba
rainabba / config-docker.sh
Last active September 6, 2022 03:46
Install docker-ce, docker-compose and docker-sync in Ubuntu for WSL
#!/bin/bash
#
#This script assumes very little other than a fresh Ubuntu install (using the Windows store) on Win10 1709 or newer with WSL installed already
#In Powershell, run the following to install WSL and Ubuntu
#
#Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
#Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.zip -UseBasicParsing
#Expand-Archive ~/Ubuntu.zip ~/Ubuntu
#~/Ubuntu/ubuntu.exe
#
@agrcrobles
agrcrobles / build.gradle
Created October 16, 2017 20:03 — forked from mateoKaradza/build.gradle
Example of signingConfigs within build.gradle file
signingConfigs {
release {
if (System.getenv()["CI"]) { // CI is true when running build on CI service, such as Bitrise
storeFile file(System.getenv()["BITRISE_SOURCE_DIR"] + "/keystores/my_keystore.jks")
storePassword System.getenv()["BITRISEIO_ANDROID_KEYSTORE_PASSWORD"]
keyAlias System.getenv()["BITRISEIO_ANDROID_KEYSTORE_ALIAS"]
keyPassword System.getenv()["BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD"]
} else {
storeFile file("release.keystore")
storePassword "Password123"
@fjmorel
fjmorel / google.script.d.ts
Created November 4, 2016 16:56
Google Apps Script client-side Typescript definitions
// Google Apps Script methods available to scripts
declare namespace google {
/**
* Methods available to Google Apps Script
*/
namespace script {
interface IUrlLocation {
/**
* The string value of URL fragment after the # character, or an emptry string if no URL fragment is present
@bdno86
bdno86 / camphor.scss
Last active August 30, 2023 07:55
camphor
$camphor300:'d09GMgABAAAAAQ5UABIAAAAEn0QAAQ3tAAEZmQAAAAAAAAAAAAAAAAAAAAAAAAAAG4SkahzOKgZgFotgAIosCCIJgnMRCAqLlgCKvTwBNgIkA5lwE4GnDguZdAAEIAW7bwcgDHJb0WS0WUXZkokWaBHx4wKbY7TigANIU/t980QCGzI/IkCsdbqJZwY1ZOgWDngIamw3I43435Dd+zJ1kNmKVp/DvXNAwaNm//////////////////+/NZkMZ5cAl0CpbZ3oiwloFA5GyIWNzOYVLt1bpXPX+pABI2fo5rMZpgVYIzYqgxt92ajECqUKh2G9gaOCVRC23VSRVypHfbvb7wYcwEM25WArF0esm1yKzDixrJRdcBGtcpBZTFbFbIl8LIU4gWOnEdSITqkoGrHWJ8ywn9eVFWWk3lC6m07qp1TXntHaWp6ekYHLrFoyzOXYiQnn2kWX2zqMaFBTca25vHKndPhJV66HRhQzL9lB3OT20KGTXuFHu62wm1qzoV/iTnaiLdc8o/D7B+1O94BrjSE3cia6U1A5XNp0kHmUj8IMBaeiGaiNJV7b1csb0bq8EWYo2h1TuipR+7hmYjxeZsonGLNcmgsKp5EUDCEj9SvRyxX2uMUNfINmfNqglBYNNtjtNmdwWV2ly4uQKheyDyka2RTRoQ3IEfs+0BNcGJ4Z5AnmHNpFbCKW5PsXkAzJ6VVzzVMo0fwIUpQQT67itTNRE946/NxDashl9KuAFUbZ6yW91vObh+WAMZ1mQ1J4wotF6KXHuo65X6wSz406hW/T6XZMf/6W+HGYUxCDfhyjPaoMGcWccmbYM/H35NdHTOd79Jg0ho/BDBvRy2vcg8pHsv07UYiKrDFeqzL0Qk7qCkXLuukl2EKuR3xS6VtsLEaT0BfWoDYoQ1YvEjjT729XNMYoCX3j+2ApedBG/UHLOJ7AAnfPSqdmmePsY+522MpfPaf7kf6fIJMn0/4SE6PmuI3yjyeGjWn+1qj/ukf09DE