Skip to content

Instantly share code, notes, and snippets.

View bjackson's full-sized avatar
🕶️

Brett Jackson bjackson

🕶️
View GitHub Profile
@mjackson
mjackson / composing-route-in-react-router-v6.md
Last active March 12, 2024 08:39
Notes on route composition in React Router v6, along with a suggested improvement you can make today to start upgrading

Composing <Route> in React Router v6

Composition of <Route> elements in React Router is changing in v6 from how it worked in v4/5 and in Reach Router. React Router v6 is the successor of both React Router v5 and Reach Router.

This document explains our rationale for making the change as well as a pattern you will want to avoid in v6 and a note on how you can start preparing your v5 app for v6 today.

Background

In React Router v5, we had an example of how you could create a element](https://github.com/remix-run/react-router/blob/320be7afe44249d5c025659bc00c3276a19f0af9/packages/react-router-dom/examples/Auth.js#L50-L52) to restrict access to certain routes on the page. This element was a simple [wrapper around an actual element that made a simple decision: is the user authenticated or not? If so, ren

@codingjoe
codingjoe / geodjango_macOS_arm64.md
Created March 11, 2021 10:29
HowTo run GeoDjango and PostGIS on M1 macOS arm64 MacBook
  1. Install PostgreSQL with PostGIS via Postges.app
  2. Install brew as recommended.
  3. Install dependencies:
    brew install geos gdal
    
  4. Add the following to your settings:
    # settings.py
    

GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')

@ryanio
ryanio / truffle_mint_dai.js
Last active December 30, 2020 22:39
Minting Dai in a Truffle Test Suite with Forked Mainnet
const { BN, ether, balance } = require("openzeppelin-test-helpers");
const { expect } = require("chai");
const { asyncForEach } = require("./utils");
// Artifacts
const ForceSend = artifacts.require("ForceSend");
// ABI
const erc20ABI = require("./abi/erc20");
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@teeberg
teeberg / circleci_2_0_cancel_redundant_builds.py
Last active October 4, 2019 16:32
CircleCI cancel redundant builds within workflows
import json
import logging
import os
import sys
from os.path import dirname, join
from time import sleep
sys.path.insert(0, join(dirname(__file__), '.env'))
import arrow
@nixpulvis
nixpulvis / ping.rs
Created November 18, 2015 21:38
A simple Ping implementation in Rust.
#![feature(ip_addr, raw)]
extern crate pnet;
use std::net::{IpAddr, Ipv4Addr};
use pnet::transport::TransportChannelType::Layer4;
use pnet::transport::TransportProtocol::Ipv4;
use pnet::transport::transport_channel;
use pnet::packet::ip::IpNextHeaderProtocols;
use pnet::packet::Packet;