Skip to content

Instantly share code, notes, and snippets.

@Strus
Strus / clangd.md
Last active March 4, 2025 15:47
How to use clangd C/C++ LSP in any project

How to use clangd C/C++ LSP in any project

tl;dr: If you want to just know the method, skip to How to section

Clangd is a state-of-the-art C/C++ LSP that can be used in every popular text editors like Neovim, Emacs or VS Code. Even CLion uses clangd under the hood. Unfortunately, clangd requires compile_commands.json to work, and the easiest way to painlessly generate it is to use CMake.

For simple projects you can try to use Bear - it will capture compile commands and generate compile_commands.json. Although I could never make it work in big projects with custom or complicated build systems.

But what if I tell you you can quickly hack your way around that, and generate compile_commands.json for any project, no matter how compilcated? I have used that way at work for years, originaly because I used CLion which supported only CMake projects - but now I use that method succesfully with clangd and Neovim.

Conventional Commit Messages

  • See how a minor change to your commit message style can make you a better problem solver and team player, help in automatic generation of the changelog and simple navigation through git history (eg. ignoring style changes).

Basic: git commit -m <message>

Detailed: git commit -m <title> -m <description>

Format: <type>(<scope>): <subject>

@jetfir3
jetfir3 / download_fusion.sh
Last active March 4, 2025 15:42
Download VMware Fusion Pro Without a Broadcom Account
#!/usr/bin/env bash
# Download VMware Fusion Pro without Bcom account
#
# By default, the latest verson will be downloaded, extracted and prepped for install
# Use '-k' to keep download file compressed, exiting after download
# Use '-v VERSION' to specify desired version (13.0.0 or higher required)
KEEP_COMPRESSED=false
USER_VERSION=""
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active March 4, 2025 15:41
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.

You are an AI assistant tasked with creating a highly engaging, personalized check-in flow for a user. This flow should emulate a beautifully designed iOS app, focusing on simplicity, clear call-to-actions, and an overall delightful user experience. Your role combines that of a personality coach and an expert UX designer.

Here's the theme for today's check-in: {{THEME}}

And here's the context we have about the user: <user_context> {{USER_CONTEXT}}

@velzie
velzie / manifest-v2-chrome.md
Last active March 4, 2025 15:40
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

@nonkronk
nonkronk / deny-all-filter-rules-mikrotik.md
Last active March 4, 2025 15:39
Securing Mikrotik: default-deny-all filter rules for VLANs

Securing Mikrotik: default-deny-all filter rules + VLANs

Notes: Some IPs are already rotated to protect the innocent.

Give Admin access to trusted local devices

/ip firewall filter
add action=reject chain=forward comment="Block Telkom Router access" \
    dst-address=172.31.100.1 dst-port=80 protocol=tcp reject-with=\
@lawrenceching
lawrenceching / install-frp-as-systemd-service.sh
Last active March 4, 2025 15:38
Install frp as systemd service
#!/bin/bash
# Update on 2024/05/29
# 1. use wget to fetch latest frp version when curl was not installed
# 2. Remind users that frp will be run in non-root user
# 3. Add CI
#
# Update on 2024/04/13
# 1. Improved OS compatibility: try wget and then curl for downloading files.
#
# Update on 2024/01/26
@kincl
kincl / puppet_cert
Last active March 4, 2025 15:37
Uses puppet certificate API to list, sign, revoke certificates
#!/bin/env python#!/bin/env python
# https://github.com/puppetlabs/puppet/blob/stable/api/docs/http_certificate_status.md
import os
import sys
import json
import requests
import argparse
import subprocess
@tsoe77
tsoe77 / json2hcl.py
Created March 4, 2025 15:30
A python script to convert JSON to HCL
#!/usr/bin/env python3
# json2hcl.py - Convert JSON to Terraform HCL
import json
import sys
import re
import argparse
from typing import Any, Dict, List, Union