Skip to content

Instantly share code, notes, and snippets.

@draincoder
draincoder / example.py
Created September 10, 2024 21:14
FastStream span linking example
import asyncio
from opentelemetry import trace
from opentelemetry.context import Context
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.trace import Link
@pierremonico
pierremonico / Localize Vue files with Django `makemessages`.md
Last active January 8, 2025 10:44
Localize Vue files with Django `makemessages`

NB: the whole approach of serving a Vue project through Django is less than ideal, so this can be seen as deprecated.

Intro

The goal of this gist is to be able to use the built-in makemessages command of Django on your Vue frontend. You can then expose a JavaScript catalog and localize your frontend using gettext.

Following assumptions are made:

  • The directory for the frontend lives in your Django project
  • You are using components (.vue files)

Include the JS Catalog view

Somewhere in urls.py:

@mrmartineau
mrmartineau / stimulus.md
Last active April 9, 2025 15:37
Stimulus cheatsheet
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 9, 2025 06:53
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 9, 2025 05:58
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@dciccale
dciccale / LICENSE.txt
Created July 31, 2011 09:30 — forked from 140bytes/LICENSE.txt
Detect if Flash Player is installed in your browser (120bytes)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Denis Ciccale <http://webdecs.wordpress.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE