Skip to content

Instantly share code, notes, and snippets.

@denisxab
denisxab / docker-compose.yml
Created June 25, 2024 16:04
Настройка собственного GitLab CI/CD сервера с помощью Docker Compose
version: "3.5"
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: "localhost"
restart: unless-stopped
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost'
gitlab_rails['gitlab_shell_ssh_port'] = 8822

Switching to Jujutsu workflows

When coming to Jujutsu, one may try to emulate their Git workflows directly. This is possible, but can cause a lot of difficulty.

This guide shows how to translate Git workflows to Jujutsu.

Getting started

Cloning an existing repository

@Flashwalker
Flashwalker / obsidian-webclip-as-markdown.user.js
Last active June 4, 2023 04:21
Obsidian web clipper. Send selected content to Obsidian as markdown
// ==UserScript==
// @name Send selected content to Obsidian as markdown
// @version 0.6.8
// @match *://*/*
// @author Flashwalker
// @description Gareth Stretton https://medium.com/@gareth.stretton/obsidian-create-your-own-web-clipper-add83c7662d0 + StackOverflow https://stackoverflow.com/questions/4176923/html-of-selected-text/4177234#4177234
// @updateURL https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714/raw/obsidian-webclip-as-markdown.user.js
// @downloadURL https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714/raw/obsidian-webclip-as-markdown.user.js
// @homepage https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714
// @require https://unpkg.com/turndown/dist/turndown.js
@nymous
nymous / README.md
Last active December 5, 2024 07:47
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)

Logging setup for FastAPI

This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.

Then, you can use Structlog loggers or standard logging loggers, and they both will be processed by the Structlog pipeline (see the hello() endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!

Requests are assigned a correlation ID with the asgi-correlation-id middleware (either captured from incoming request or generated on the fly). All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented. This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog. You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom

@eatonphil
eatonphil / psql-srv.py
Last active April 28, 2024 09:26 — forked from matteobertozzi/psql-srv.py
postgres "server" wire protocol example (ported python3)
# th30z@u1310:[Desktop]$ psql -h localhost -p 55432
# Password:
# psql (9.1.10, server 0.0.0)
# WARNING: psql version 9.1, server version 0.0.
# Some psql features might not work.
# Type "help" for help.
#
# th30z=> select foo;
# a | b
# ---+---
@zeux
zeux / clang27.md
Last active January 27, 2024 11:45
How does clang 2.7 hold up in 2021?

A friend recently learned about Proebsting's law and mentioned it to me off hand. I knew about the law's existence but I never really asked myself - do I believe in it?

For people who aren't aware, Proebsting's law states:

Compiler Advances Double Computing Power Every 18 Years

Which is to say, if you upgrade your compiler every 18 years, you would expect on average your code to double in performance on the same hardware.

Let's C about this

@disco0
disco0 / index.md
Last active November 24, 2024 18:09
Imagus Sieve #doc

Imagus Seive Configuration

A basic outline on seive configuration in Imagus—based on previous posts by developer, with additions based on own usage.

Extension Implementation

Input Processing

Before it's sent to matching, every URL has its protocol and subdomain removed using the following regex:

@reegnz
reegnz / README.md
Last active October 15, 2024 20:10
Implementing a jq REPL with fzf

Implementing a jq REPL with fzf

Update: I created jq-zsh-plugin that does this.

One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).

Another one of my favourite tools is fzf.

@s3rgeym
s3rgeym / Arch-Install-SED-Luks-Btrfs.md
Last active November 8, 2024 07:58
Установка Arch Linux с шифрованием всего диска либо раздела и Btrfs

image

Вся суть харча™ (на самом деле все далеко не так...)

Установка Arch Linux с шифрованием всего диска либо раздела и Btrfs