Skip to content

Instantly share code, notes, and snippets.

View luishendrix92's full-sized avatar

Luis Felipe López G. luishendrix92

View GitHub Profile
@saolsen
saolsen / draw-2d.cljs
Last active June 22, 2021 06:45
2d canvas drawing in clojurescript
(ns saolsen.draw-2d)
;; Draw stuff (and never care about ie ever)
;; There's obviously a ton this lib doesn't do, just adding what
;; I need when I need it.
(def request-animation-frame
(or js/requestAnimationFrame
js/webkitRequestAnimationFrame))
(defn get-canvas-context-from-id
@Strus
Strus / clangd.md
Last active June 26, 2024 13:50
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.