Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 5, 2024 05:42
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@pauloxnet
pauloxnet / djangoconus.md
Created January 19, 2024 11:13
DjangoCon US

DjangoCon US

Here are DjangoCon US talk recordings ordered by views as of 2024-01-19:

$ yt-dlp -j --flat-playlist https://www.youtube.com/@DjangoConUS | jq -r '.|[.view_count,.url,.title]|@tsv' | sort -nr
55064	https://www.youtube.com/watch?v=XXG-ESzB9Q8	DjangoCon US 2016 - Building Dynamic Dashboards With Django and D3 by Clinton Dreisbach
20791	https://www.youtube.com/watch?v=zYHv6U86X0Y	DjangoCon US 2016 - Django and React: Perfect Together by Jack McCloy
20730	https://www.youtube.com/watch?v=pY-oje5b5Qk	DjangoCon US 2018 - Finally Understand Authentication in Django REST Framework by William S. Vincent
19728	https://www.youtube.com/watch?v=695y8rdHsA4	DjangoCon 2019 - Django REST Framework: Taking your API to the next level by Carlos Martinez
@thibaudcolas
thibaudcolas / talks-id-like-to-see.md
Last active February 9, 2024 14:10
Django & Wagtail talks I’d like to see
@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@joshuadavidthomas
joshuadavidthomas / decorators.py
Last active February 7, 2024 15:10
if `neapolitan.views.CRUDView` and `rest_framework.viewsets.Viewset`/`rest_framework.routers.SimpleRouter` had a baby, it would be ugly as hell
def route(methods=None, detail=None, url_path=None, url_name=None, **kwargs):
"""
Mark a ViewSet method as a routable action.
`@action`-decorated functions will be endowed with a `mapping` property,
a `MethodMapper` that can be used to add additional method-based behaviors
on the routed action.
:param methods: A list of HTTP method names this action responds to.
Defaults to GET only.
@april
april / find-all-electron-versions.sh
Last active March 15, 2024 00:56
find all apps using Electron and their versions, on macOS systems
#!/usr/bin/env zsh
# patched versions for CVE-2023-4863: 22.3.24, 24.8.3, 25.8.1, 26.2.1
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
echo "App Name: $(basename ${app})"
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
@dryan
dryan / middleware.py
Created September 13, 2023 14:40
Django CSP Middleware
import random
import string
import typing
from django.conf import settings
# if you have a Report-To service, add it to settings.py along with
# adding ReportToMiddleware to settings.MIDDLEWARE
@veekaybee
veekaybee / normcore-llm.md
Last active May 4, 2024 21:03
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 22, 2024 08:47
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@harkabeeparolus
harkabeeparolus / Typer_cheat_sheet.md
Last active April 19, 2024 04:53
Typer — my attempt at reference documentation