Skip to content

Instantly share code, notes, and snippets.

@pySilver
pySilver / readme.md
Created August 14, 2024 22:57 — forked from wallyqs/readme.md
JetStream on Docker with Docker Compose

First, create a few volumes so that state is persisted across restarts:

docker volume create nats1
docker volume create nats2
docker volume create nats3

Now create a docker-compose.yaml with the following:

@pySilver
pySilver / iterm2-solarized.md
Created April 23, 2021 08:59 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@pySilver
pySilver / field_block.py
Last active November 26, 2019 22:56
ModelChoiceBlock & MultipleModelChoiceBlock for Wagtail CMS
from typing import List, Optional
from django import forms
from django.db.models import Model, QuerySet
from django.utils.functional import cached_property
from wagtail.core.blocks import FieldBlock
from wagtail.core.utils import resolve_model_string
from dal_select2.widgets import ModelSelect2, ModelSelect2Multiple
@pySilver
pySilver / admin.scss
Last active November 15, 2023 09:39
Integrates wagtail + wagtailmodeladmin + django-filter + django-autocomplete-light
/*
* ===================================================
* django-filter
* ===================================================
*/
.filter-form-header {
padding: 0;
h2 {
background-color: #fafafa;
@pySilver
pySilver / 10_ansible_vault_check.py
Created January 29, 2016 19:42
Pre-commit check for ansible-vault encrypted files
#!/usr/bin/env python
import sys
import os
import re
import subprocess
def git(args, **kwargs):
environ = os.environ.copy()
if 'repo' in kwargs:
==== SNIP ====
class DistanceSerializer(serializers.Serializer):
km = serializers.FloatField()
m = serializers.FloatField()
mi = serializers.FloatField()
ft = serializers.FloatField()
class SearchResultSerializer(serializers.Serializer):