Skip to content

Instantly share code, notes, and snippets.

View SeeThruHead's full-sized avatar

Shane Keulen SeeThruHead

View GitHub Profile

#Recompose Workshop

##Stateless Function Components

Review stateless function components

  • best way to code markup
  • they take an object props, as their first arg, and context as second
  • they return jsx
  • they have no state...
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../constants/ActionTypes';
export default (state = 0, action) => ({
[actions.increment]: (state )=> state + 1,
[actions.decrement]: (state) => state - 1,
default: state => state
}[action.type || 'default'](state, action.payload))
@SeeThruHead
SeeThruHead / reduce operation benchmark.js
Last active March 21, 2018 06:28
what's faster for uniqueness in an array
require('babel-polyfill');
var uuid = require('uuid');
var faker = require('faker');
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
var chunkify = require('chunkify');
const createFakeArray = range => {
const arr = [];
for (let i = 0; i < range; i ++) {
@SeeThruHead
SeeThruHead / Wizard.jsx
Created September 27, 2025 00:35
clauded wizard
import React, { useState, useEffect, useRef, createContext, useContext } from 'react';
// Wizard Context
const WizardContext = createContext();
// Wizard Root Component
const WizardRoot = ({ children, onPageChange }) => {
const [currentPage, setCurrentPage] = useState(0);
const [totalPages, setTotalPages] = useState(0);
const formRef = useRef(null);

Exposing Homelab Services via Cloudflare Tunnel with Authelia SSO

This guide covers setting up external access to your homelab services through Cloudflare Tunnels, with Authelia providing single sign-on protection. The end result: you can access sonarr.yourdomain.com from anywhere, protected by 2FA, without opening any ports on your router.

The Traffic Flow

Internet → Cloudflare → cloudflared container → Traefik → Authelia check → Your service