Skip to content

Instantly share code, notes, and snippets.

@Strus
Strus / clangd.md
Last active January 21, 2025 14:19
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.

@epcim
epcim / update-ca-certificates.md
Last active January 21, 2025 14:18
trusted certificates system update-ca-certificates

Adding trusted root certificates to the server

Mac OS X

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/new-root-certificate.crt
sudo security delete-certificate -c "<name of existing certificate>"

Windows

certutil -addstore -f "ROOT" new-root-certificate.crt

@0xjac
0xjac / private_fork.md
Last active January 21, 2025 14:17
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@yifanzz
yifanzz / code-editor-rules.md
Created December 17, 2024 00:01
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active January 21, 2025 14:15
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@braindevices
braindevices / #btrfs benchmark for daily used desktop OS
Last active January 21, 2025 14:12
which file sytem to use for daily work? should we turn on btrfs compression?
#btrfs benchmark for daily used desktop OS
@dkartachov
dkartachov / disable_wakeup_events.md
Last active January 21, 2025 14:09
Disable USB wakeup events on Linux

Disable USB wakeup events on Linux

I'm almost certain these steps will work on most distros but I've only been able to test on Linux Mint 21. Feel free to test on your own distros and add to the list :)

Tested on:

  • Linux Mint 21

Steps

  1. Run lsusb and lsusb -t to identify USB devices and what Bus/Port they are connected to
  2. Let's say you've identified Bus 1 -> Port 13 -> Port 1 in the listed tree, run:
@TaylorBurnham
TaylorBurnham / NINA_Tokens.md
Last active January 21, 2025 14:06
N.I.N.A Tokens for Astrophotography

N.I.N.A Astrophotography Tokens

I wanted a place other than the UI to reference tokens for configuring complex sequences. Please comment with any discrepancies or updates.

N.I.N.A Image Naming Tokens

Pulled from the source at nina on branch release/2.0 and commit f19a006.

Token Description
@IonBazan
IonBazan / flag.php
Created October 22, 2021 09:27
Country code to country flag Emoji (PL -> 🇵🇱)
<?php
/**
* Converts country code (ISO 3166-1) to its emoji flag representation (PL -> 🇵🇱).
*
* This solution supports both lowercase and uppercase codes using modulo 32 .
* Since it doesn't perform any validation, you should make sure the code is a valid country code first.
*
* 0x1F1E5 is a code of character right before "REGIONAL INDICATOR SYMBOL LETTER A" (🇦).
*
@chranderson
chranderson / nvmCommands.js
Last active January 21, 2025 14:04
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node