Skip to content

Instantly share code, notes, and snippets.

View qnm's full-sized avatar

Rob qnm

  • Sydney, Australia
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
@jmatsushita
jmatsushita / README
Last active April 28, 2024 14:42
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@SolarLiner
SolarLiner / flake.lock
Last active March 7, 2024 04:11
Nix home-manager config
{
"nodes": {
"coc-omnisharp": {
"flake": false,
"locked": {
"lastModified": 1608601047,
"narHash": "sha256-ADlvOZX4q6tcUAV5NPoQyNmBlrUGjPkI2ohNcAjsAEQ=",
"owner": "coc-extensions",
"repo": "coc-omnisharp",
"rev": "7a224248758e53bd8920ba52033d0e721f6d4742",
# frozen_string_literal: true
class SlowCall
def self.work
@work ||= Concurrent::Promises.future(name: "load #{self.class.name}") do
sleep 2
Time.now
end
end
end
@kppullin
kppullin / config.fish
Created May 16, 2020 03:51
Fish shell + WSL2 + gnome-keyring / secret-tool
#
# This fish config sets up a working `gnome-keyring` on WSL2.
# I imagine it will work with WSL1 as well, perhaps after adjusting the `DISPLAY` value.
#
# Based off this bash script: https://askubuntu.com/questions/815327/running-gnome-keyring-on-wsl-windows-subsystem-for-linux
# Tested and working with `aws-vault` and `jetbrains-toolbox`.
#
# Be sure your x server is running!!!
set -x DISPLAY (cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
#!/bin/bash
set -euo pipefail
# uncomment to debug
# set -x
echo "1️⃣. Does catalina know to create the nix directory?"
if ! grep nix /etc/synthetic.conf > /dev/null 2>&1; then
echo "nix missing from /etc/synthetic.conf. Adding it (will request sudo)"
echo "nix" | sudo tee -a /etc/synthetic.conf > /dev/null
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@wenwu449
wenwu449 / hhkb.ahk
Last active February 8, 2023 03:11
AutoHotKey script to map normal keyboard to HHKB pro2
;
; HHKB layout
;
; ,-----------------------------------------------------------.
; |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |
; |-----------------------------------------------------------|
; |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|BackS|
; |-----------------------------------------------------------|
; |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return |
; |-----------------------------------------------------------|
@groyoh
groyoh / ams_1950.rb
Last active December 21, 2017 05:12
AMS #1950
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'active_model_serializers', '0.10.2'
@austinmao
austinmao / 1.gallery.js
Last active January 13, 2016 05:04
Higher Order Component and Higher Order Reducer example that creates a reusable, redux-connected photo gallery that will store a `selected` state in a unique, nested name + key object in the redux store. This differs from https://gist.github.com/austinmao/b2da974571d11e3f24f3 by allowing the key to be passed in via props from one component to an…