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
@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 July 9, 2024 20:53
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 July 13, 2024 00:43
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 April 23, 2024 18:36
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 July 6, 2024 12:54
Установка Arch Linux с шифрованием всего диска либо раздела и Btrfs

image

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

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

@mardahl
mardahl / retry-intune-enrollment.ps1
Last active August 5, 2022 17:07
Intune Enrollment problem solver script thingy
# Clean out MDM registration info from machine, in attempt to fix Intune enrollment problems with Windows 10
# after a user reboots, the enrollment process should kick off again.
# This special edition, also disables workplace join, as an attempt to mitigate issues with devices previously AAD Registered.
# This script has fixed Error codes 0x80180023 and 0x8018002b at some of my customers sites, even without reboot in some cases.
# By Michael Mardahl @ Apento.com - @michael_mardahl
# Should be run as system user
#Disable workplace join if that is happening beyond your control.
#Get-ScheduledTask -TaskName "Automatic-Device-Join" | Disable-ScheduledTask