Skip to content

Instantly share code, notes, and snippets.

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

​8dcc​ 8dcc

™️
™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️™️
View GitHub Profile
@8dcc
8dcc / remove-element.js
Created October 10, 2021 18:24
Remove element with violentmonkey.
GM_addStyle ( `
.element-thing {
display: none !important;
}
` );
@8dcc
8dcc / remove-telegram-chat-list.js
Created October 12, 2021 19:54
Remove telegram chat list.
// ==UserScript==
// @name Hide bar telegram
// @namespace Violentmonkey Scripts
// @include *.telegram.org/*
// @grant GM_addStyle
// @run-at document-start
// @author Null
// ==/UserScript==
GM_addStyle (`
@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 / hide-telegram-bar.js
Created October 19, 2021 02:08
Userscript to remove telegram contact list.
// ==UserScript==
// @name Hide bar telegram
// @namespace Violentmonkey Scripts
// @include *.telegram.org/*
// @grant GM_addStyle
// @run-at document-start
// @author r4v10l1
// ==/UserScript==
GM_addStyle (`
// ==UserScript==
// @name Remove autodownload shit from moodle
// @namespace Violentmonkey Scripts
// @match https://yoursite.org/*
// @grant none
// @version 1.0
// @author Null / r4v10l1
// @description 01/10/2021, 01:23:03
// ==/UserScript==
@8dcc
8dcc / compile.sh
Last active May 30, 2022 10:58
Draw a window example in C. Tested in arch with dwm and sdl2.
#!/bin/bash
# Check if sdl2 is installed
if [[ $(command -v sdl2-config) == "" ]]; then
echo "Cant' find sdl2. Exiting..."
exit 1;
fi
SDL_FLAGS=$(sdl2-config --cflags --libs)
@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..."
@8dcc
8dcc / 2d-arrays.c
Created March 17, 2022 17:00
Simple way to pass 2d arrays to a C function.
#include <stdio.h>
#define ARRAY_SIZE 10
int test(int* array, int ys, int xs) {
int desiredx = 5;
int desiredy = 3;
array[desiredy * xs + desiredx] = 1;
array[desiredy * ys + desiredx] = 2;
@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 / rsync-windows.sh
Last active April 12, 2022 18:48
Using rsync in windows (External drive)
# Will backup the 'D:/Stuff' folder to 'E:/Stuff' (Will create the folder if does not exist)
rsync -av /cygdrive/d/Stuff /cygdrive/e
# Will ignore exising files
rsync -av --ignore-existing /cygdrive/d/Stuff /cygdrive/e
# Will delete files that no longer exist in 'D:/Stuff'
rsync -av --delete /cygdrive/d/Stuff /cygdrive/e