Skip to content

Instantly share code, notes, and snippets.

View KnIfER's full-sized avatar

knziha KnIfER

View GitHub Profile
@runevision
runevision / ErosionNoise.cs
Last active September 10, 2025 11:35
Erosion noise implementation in C#
/*
Erosion noise implementation in C# (with the Unity.Mathematics package),
ported one-to-one from the Shadertoy shader code by Fewes and clayjohn.
Please note that while the majority of the code is provided under the MIT license,
the quite central "erosion" function is adapted from code shared under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Shadertoy comment by Fewes from https://www.shadertoy.com/view/7ljcRW :
@vogler
vogler / youtube-progress-always.tamper.js
Last active April 17, 2025 11:30
Tampermonkey: YouTube: always show an additional progress bar below the video (not just on mouse move or pause)
// ==UserScript==
// @name YouTube: always show a progress bar
// @namespace https://gist.github.com/vogler
// @downloadURL https://gist.github.com/vogler/f0bba0a52a6fed61afab19245e72b5d4/raw/youtube-progress-always.tamper.js
// @version 0.6
// @description YouTube: always show an additional progress bar below the video (not just on mouse move or pause)
// @author Ralf Vogler
// @ match https://www.youtube.com/watch?v=* // this will not work if you open youtube.com and then click on a video since it is a SPA
// @match https://www.youtube.com/*
// @grant none
@3735943886
3735943886 / SetDeviceState.c
Last active January 25, 2024 08:46
Disable or Enable Device with Hardware ID
/* for Devpkey */
#define INITGUID
/* dependencies */
#pragma comment (lib, "SetupAPI")
#include <windows.h>
#include <SetupAPI.h>
#include <Devpkey.h>
VOID SetDeviceState(LPCWSTR lpszHardwareId, DWORD dwState)
@comargo
comargo / README.md
Last active June 28, 2024 15:52
OutputDebugString with cpp std::ostream

Sven Axelsson 24 Nov 2001

How to create an output stream that writes to the debug terminal.

Background

There are many different schools of how to debug a program (yeah, I know - write it correctly from the start), but whatever tools you prefer it is often very convenient just to use the printf approach. Well, since you are a modern C++ kind of person, you don't really want printf, you want to use an output stream, like cerr.

@sankarara
sankarara / monitor-off.ahk
Created March 23, 2016 14:29
AutoHotKey: Turn monitor off with a keyboard shortcut
; This is part of my AutoHotkey [1] script that turns off my monitor when I
; press Win+\.
; It also turns the screensaver on at the same time, so that Windows Live
; Messenger (and any other programs) know I am away.
; I don't have a password on my screensaver, so there is a second version
; (Win+Shift+\) that locks the PC as well.
; Note: Sometimes the monitor comes back on after a second and I have to
@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){