Skip to content

Instantly share code, notes, and snippets.

@pynappo
pynappo / neovim-lsp-explainer.md
Last active May 14, 2024 16:22
A chart describing neovim lsp vs coc
%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart LR
  subgraph LSP
    subgraph lsp.install [Install language servers]
      subgraph mason-pkg [Local to neovim]
        mason.nvim
      end
      system-pkg["System
      package managers"]

Hyper-converged High Available Homelab with Proxmox

This is me documenting my journey moving my Homelab from a Qnap NAS and a Single host Proxmox server to a Hyper-converged multi-node Proxmox Cluster.

The reason to document it here is twofold:

  1. Information often it scattered 'all over the place', but never 100% applicable to the setup I have.
  2. To remember 'what the fuck' did I do some months ago.
  3. Writing it for 'a public' forces me to think it all through again and make sure it's correct.

It's written 'first to scratch my own itch' but hopefully it benefits others too, or even better, that others improve upon my implementations. Feel free to comment or share improvements and insights!

@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@zbeekman
zbeekman / GH-CF-strict-SSL-w-CDN.md
Last active May 14, 2024 16:11
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@jidckii
jidckii / alertmanager.tmpl
Created April 5, 2023 14:08
Alertmanager telegram template
{{ define "__yucca_text_alert_list" }}{{ range . }}
---
🪪 <b>{{ .Labels.alertname }}</b>
{{- if .Annotations.summary }}
📝 {{ .Annotations.summary }}{{ end }}
{{- if .Annotations.description }}
📖 {{ .Annotations.description }}{{ end }}
🏷 Labels:
{{ range .Labels.SortedPairs }} <i>{{ .Name }}</i>: <code>{{ .Value }}</code>
{{ end }}{{ end }}
@cshenton
cshenton / d3d11_triangle.c
Last active May 14, 2024 16:09
D3D11 Triangle in C99
#include <assert.h>
#define COBJMACROS
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define TITLE "D3D11 Triangle C"
@jorgensd
jorgensd / script.py
Created May 14, 2024 16:01
Write VTK HDF mesh from DOLFINx
# Author: Jørgen S. Dokken
# SPDX-License-Identifier: MIT
from pathlib import Path
from mpi4py import MPI
import h5py

Elixir Logo DB (script)

Esse é um script para rodar alguns comandos do postgres + ecto :thumbsup-parrot:

Requisitos

Esse script requer 🎀 gum!

Scripts

Você deve colocar as funções abaixo no seu .zshrc ou em um arquivo separado para usar o db:

function ecto() {
@augbog
augbog / .Frontend Technical Interview Prep.md
Last active May 14, 2024 16:04
Frontend Technical Interview Prep: A study guide of things I constantly re-review when interviewing for frontend.

Frontend Technical Interview Prep

EDIT: Well this has been linked now so just an FYI this is still TBD. Feel free to comment if you have suggestions for improvements. Also here is an unrolled Twitter thread of a lot of the tips I talk about on here.

I've been doing frontend for a while now and one thing that really gripes me is the interview. I think the breadth of knowledge of a "Frontend Engineer" has been so poorly defined that people really just expected you to know everything. Many companies have made this a hybrid role. The Web is massive and there are many MANY things to know. Some of these things are just facts that you learn and others are things you really have to understand.

Every time I interview, I go over the same stuff. I wanted to create a gist of the TL;DR things that would jog my memory and hopefully yours too.

Lots of these things are real things I've been asked that caught me off guard. It's nice to have something you ca

@moelody
moelody / feedbro-locale-zh_CN.json
Last active May 14, 2024 16:04
feedbro中文翻译
{
"meta": {
"manifest_version": 3,
"locale_version": "1.3",
"locale_name": "简体中文",
"locale_type": "zh_CN",
"locale_last_updated": "2020-08-07 18:00:00 UTC",
"locale_author_name": "moelody",
"locale_author_email": "yfsmallmoon@gmail.com",
"locale_source_url": "https://gist.github.com/moelody/3159316ce726fc629fae15278bbce429"