Skip to content

Instantly share code, notes, and snippets.

View 8dcc's full-sized avatar
™️
™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️

​8dcc​ 8dcc

™️
™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️
View GitHub Profile
@Strus
Strus / clangd.md
Last active April 16, 2025 21:15
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.

@8dcc
8dcc / userscript-function-delay.js
Created April 17, 2022 02:41
Add custom delay to userscript functions.
// ==UserScript==
// @name Delay function
// @namespace Violentmonkey Scripts
// @include *://example.com/*
// @run-at document-start
// @author Null (r4v10l1)
// ==/UserScript==
// --------------------- Settings ---------------------
var MY_DELAY = 500; // ms, delayChecker will wait this
@8dcc
8dcc / docker-cheatsheet.sh
Last active August 26, 2022 17:09
Docker cheatsheet
# Build image
docker build -d image_name .
# Run image in daemon and remove after exit
docker run --name container_name --rm -it -d image_name
# Clear images without tag
docker rmi $(docker images -f "dangling=true" -q)
# Clone an image's tag
@8dcc
8dcc / compile.sh
Last active January 18, 2022 15:00
#!/bin/sh
##############################
# For linux only. Usage:
# ./compile.sh FILE.c [run]
##############################
# Check if sdl2 is installed
if [[ $(command -v sdl2-config) == "" ]]; then
echo "Cant' find sdl2. Exiting..."
@klange
klange / _.md
Last active February 16, 2025 01:29
12 Years of ToaruOS

12 Years of ToaruOS

This is a repost and update to an imgur album with screenshots of ToaruOS throughout its development, as imgur is no longer a viable platform for maintaining this collection.

Early Development

My first commit in the ToaruOS repository, ecd4fe2bc170b01ad700ff76c16da96993805355, was made on January 15th, 2011. This date has become ToaruOS's "birthday". It would be another six years and two weeks before ToaruOS's first real release, 1.0.

1 - eL4aHBZ - Humble Beginnings

@8dcc
8dcc / remove-a-commit.md
Last active November 30, 2021 23:09
How to remove a recent commit.

How to remove a recent commit.

By restoring a recent commit, previous to the ones you want to delete, and then adding the ones you want to recover.

Based on here. Cherry Pick method.

Let's say these are our recent commits:

Number | Hash | Commit Message | Author

@8dcc
8dcc / csgo-autoexec.cfg
Last active November 17, 2023 23:03
My personal csgo/tf2 autoexec
echo
echo "⠀⠀⠀⠀⠀⢀⣴⡾⠿⠿⠿⠿⢶⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
echo "⠀⠀⠀⠀⢠⣿⠁⠀⠀⠀⣀⣀⣀⣈⣻⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀"
echo "⠀⠀⠀⠀⣾⡇⠀⠀⣾⣟⠛⠋⠉⠉⠙⠛⢷⣄⠀⠀⠀⠀⠀⠀⠀"
echo "⢀⣤⣴⣶⣿⠀⠀⢸⣿⣿⣧⠀⠀⠀⠀⢀⣀⢹⡆⠀⠀⠀⠀⠀⠀"
echo "⢸⡏⠀⢸⣿⠀⠀⠀⢿⣿⣿⣷⣶⣶⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀"
echo "⣼⡇⠀⢸⣿⠀⠀⠀⠈⠻⠿⣿⣿⠿⠿⠛⢻⡇⠀⠀⠀⠀⠀⠀⠀"
echo "⣿⡇⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣼⣷⣶⣶⣶⣤⡀⠀⠀"
echo "⣿⡇⠀⢸⣿⠀⠀⠀⠀⠀⠀⣀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀"
echo "⢻⡇⠀⢸⣿⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⡇"
@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@guac42
guac42 / music_bot_example.py
Last active December 2, 2022 22:56 — forked from vbe0201/music_bot_example.py
A simple music bot written using discord.py rewrite and youtube_dl.
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Valentin B.
A simple music bot written in discord.py using youtube-dl.
Though it's a simple example, music bots are complex and require much time and knowledge until they work perfectly.
Use this as an example or a base for your own bot and extend it as you want. If there are any bugs, please let me know.
Requirements:
Python 3.5+
pip install -U discord.py pynacl youtube-dl
// ==UserScript==
// @name Twitch Channel Points autoclaimer
// @version 1.0.0
// @description Automatically clicks the chest to claim the Twitch channel points
// @author jammy
// @match https://twitch.tv/*
// @match https://www.twitch.tv/*
// @grant none
// ==/UserScript==