Skip to content

Instantly share code, notes, and snippets.

Avatar
🤌
I enjoy the act of touching grass

Null r4v10l1

🤌
I enjoy the act of touching grass
View GitHub Profile
@r4v10l1
r4v10l1 / hsvrgb.cpp
Last active Jun 4, 2022 — forked from fairlight1337/hsvrgb-cpp
Simple RGB/HSV conversion in C++
View hsvrgb.cpp
// Copyright (c) 2014, Jan Winkler <winkler@cs.uni-bremen.de>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
@r4v10l1
r4v10l1 / get-links.js
Created May 17, 2022
Get all the hrefs from a page's links.
View get-links.js
@r4v10l1
r4v10l1 / clone-important.sh
Last active Apr 23, 2022
Bash script for cloning my most important repos (a lot). Mostly for local backups.
View clone-important.sh
#!/bin/bash
repos=(
"vat"
"v-stuff"
"browser-homepage"
"discord-bot"
"vim-dotfiles"
"dotfiles"
"langtons-ant-c"
@r4v10l1
r4v10l1 / userscript-function-delay.js
Created Apr 17, 2022
Add custom delay to userscript functions.
View userscript-function-delay.js
// ==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
@r4v10l1
r4v10l1 / remove-video-suggestions.js
Last active Apr 17, 2022
Userscript for removing the suggestions on youtube. Useful if you use youtube on a vertical monitor.
View remove-video-suggestions.js
// ==UserScript==
// @name Remove suggestions YouTube
// @namespace Violentmonkey Scripts
// @include *://*.youtube.com/*
// @grant GM_addStyle
// @run-at document-idle
// @author Null (r4v10l1)
// ==/UserScript==
GM_addStyle (`
@r4v10l1
r4v10l1 / single-pull.md
Created Apr 6, 2022
Single pull a file with git.
View single-pull.md
git fetch --all
git checkout origin/master -- <your_file_path>
git add <your_file_path>
git commit
#git commit -m "<your_file_name> updated"
@r4v10l1
r4v10l1 / rsync-windows.sh
Last active Apr 12, 2022
Using rsync in windows (External drive)
View rsync-windows.sh
# 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
View docker-cheatsheet.sh
# 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
@r4v10l1
r4v10l1 / 2d-arrays.c
Created Mar 17, 2022
Simple way to pass 2d arrays to a C function.
View 2d-arrays.c
#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;
View compile.sh
#!/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..."