Skip to content

Instantly share code, notes, and snippets.

View destos's full-sized avatar

Patrick Forringer destos

View GitHub Profile

HTMX Reference for AI Context

This work is marked CC0 1.0

Overview

HTMX extends HTML with attributes that enable AJAX requests, CSS transitions, WebSockets, and Server-Sent Events directly in markup. Responses are HTML fragments, not JSON.

Core principle: Server returns HTML, HTMX swaps it into the DOM.

@bolu61
bolu61 / cursed.py
Last active February 28, 2025 17:54
Cursed decorators
# Chapter 1: immediate evaluation with optional composition
@lambda f: not f()
def true() -> bool:
return False
assert true == True # ???
# Chapter 2: single line composition

Optimizing Django and Celery for Handling Many Concurrent Requests

Handling a high volume of concurrent requests in a Django application with Celery for background tasks can be challenging. This guide will walk you through the necessary steps to optimize your setup for better performance and scalability.

Default Setup with Gunicorn and Celery

By default, Gunicorn with Django and Celery uses synchronous workers to handle web requests and background tasks. This means:

  • Gunicorn: Uses sync workers which can handle one request at a time per worker.
  • Celery: Processes tasks synchronously within each worker.
@tomhicks
tomhicks / plink-plonk.js
Last active December 26, 2025 08:35
Listen to your web pages
@thomasnorris
thomasnorris / Raspberry Pi Kiosk Setup.md
Last active October 22, 2023 03:36
Instructions for installing a fresh image of Raspbian and turning the Pi into a kiosk (for google slides, google photos, etc)

Raspberry Pi Kiosk Setup

  • Install a fresh image of Raspbian and boot the Pi
  • Go through the prompts to finish initial setup
  • Open a Termial window
    • Type sudo apt-get install unclutter
    • Type sudo raspi-config
      • Select Boot Options with Enter
        • Select Wait for Network at Boot with Enter
        • Select Yes with Enter
@CarsonMcKinstry
CarsonMcKinstry / LocationProvider.js
Last active July 2, 2020 09:12
A geo location provider built using the React v16.3 context API
import React, { Component } from 'react';
import { number, string } from 'prop-types';
export const { Provider, Consumer } = React.createContext();
export const locationConsumer = Component => props => {
return (
<Consumer>
{ ctx => <Component {...ctx} {...props}/> }
@cschiewek
cschiewek / x11_docker_mac.md
Last active September 9, 2025 01:27
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@almereyda
almereyda / falsehoods.md
Created April 14, 2016 15:11 — forked from wboykinm/falsehoods.md
Falsehoods programmers believe about addresses

Falsehoods programmers believe about addresses

This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.

An address will start with, or at least include, a building number.

Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.

When there is a building number, it will be all-numeric.

Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT

@Zequez
Zequez / init.coffee
Last active February 26, 2023 15:19
Comment out JSX code on Atom
# If you worked with React and JSX you probably noticed that you can't use JS comments when inside JSX sections
# Add this to your Atom init script
# Then add 'ctrl-cmd-/': 'comment-jsx' to your keymap.cson
# Then when you are on a JS/JSX file, just press cmd+ctrl+/ to use JSX-style comments that work with JSX elements
# Is not the most efficient way, but it's the cleanest and reliable one
atom.commands.add 'atom-workspace', 'comment-jsx', ->
atom.config.set('editor.commentStart', '{/*', {scopeSelector: '.source.js.jsx'})
atom.config.set('editor.commentEnd', '*/}', {scopeSelector: '.source.js.jsx'})
for selection in atom.workspace.getActiveTextEditor().selections
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active February 3, 2026 15:39
An Open Letter to Developers Everywhere (About Cryptography)