Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / pasos-node-typescript.md
Last active May 5, 2024 08:06
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
@wokamoto
wokamoto / wp-custom-search.php
Last active May 5, 2024 08:06
WordPress でユーザー名とか、タグ名・カテゴリ名も検索対象に
<?php
function custom_search($search, $wp_query) {
global $wpdb;
//サーチページ以外だったら終了
if (!$wp_query->is_search)
return $search;
if (!isset($wp_query->query_vars))
return $search;
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active May 5, 2024 08:03
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

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!

Docker Swarm in LXC Containers

Part of collection: Hyper-converged Homelab with Proxmox

After struggling for some days, and since I really needed this to work (ignoring the it can't be done vibe everywhere), I managed to get Docker to work reliable in privileged Debian 12 LXC Containers on Proxmox 8

(Unfortunately, I couldn't get anything to work in unprivileged LXC Containers)

There are NO modifications required on the Proxmox host or the /etc/pve/lxc/xxx.conf file; everything is done on the Docker Swarm host. So the only obvious candidate who could break this setup, are future Docker Engine updates!

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

From self[at]sungpae.com Mon Nov 8 16:59:48 2021
Date: Mon, 8 Nov 2021 16:59:48 -0600
From: Sung Pae <self[at]sungpae.com>
To: security@docker.com
Subject: Permissive forwarding rule leads to unintentional exposure of
containers to external hosts
Message-ID: <YYmr4l1isfH9VQCn@SHANGRILA>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature"; boundary="QR1yLfEBO/zgxYVA"
@lschmierer
lschmierer / dark_fusion.py
Last active May 5, 2024 07:46 — forked from QuantumCD/Qt 5 Dark Fusion Palette
Qt5 Dark Fusion Palette for Python
qApp.setStyle("Fusion")
dark_palette = QPalette()
dark_palette.setColor(QPalette.Window, QColor(53, 53, 53))
dark_palette.setColor(QPalette.WindowText, Qt.white)
dark_palette.setColor(QPalette.Base, QColor(25, 25, 25))
dark_palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53))
dark_palette.setColor(QPalette.ToolTipBase, Qt.white)
dark_palette.setColor(QPalette.ToolTipText, Qt.white)
@VAnsimov
VAnsimov / HostingView Example.swift
Last active May 5, 2024 07:43
SwiftUI View to UIView
import UIKit
import SwiftUI
// SwiftUI
struct SomeView: View {
var body: some View {
Text("Hello World!")
}
}