Skip to content

Instantly share code, notes, and snippets.

View Ruffo324's full-sized avatar
💭
I computer. (This is now a verb.) Generally this means programming. 🐯

Groot Ruffo324

💭
I computer. (This is now a verb.) Generally this means programming. 🐯
View GitHub Profile
@Ruffo324
Ruffo324 / app.js
Created February 20, 2022 04:51
@SlothOath - avereage temperature amplitude - possible solutions with benchmarks
const temperatures = [3, -2, -6, -1, 'error', 9, 13, 17, 15, 14, 9, 5, "", undefined, null, NaN],
benchmarkRunFuncXTimes = 1000,
toBenchmark = {};
// ===========================================================================================
// Mögliche Lösungen:
// ===========================================================================================
toBenchmark.filterSortLastAndFirst = function (range) {
let minAndMax = range.filter(t => !isNaN(t)).sort((a, b) => a - b);
return minAndMax.at(-1) - minAndMax.at(0);
@Ruffo324
Ruffo324 / readme.md
Last active October 3, 2021 18:00
[WORKAROUND] G-HUB not detecting Steam Games wich not installed on C libary

Problem

Logitech's G HUB is .. a good Configuration Software wich is missing some fundamental things.
One of them, is the abillity to detect Steam games wich are installed on diffrent drives/libary.

Requirements

  • latest Windows 10 update.
  • latest Steam
  • other libary must placed on a drive wich is large enough to hold all your games. (written 03.10.2021)
@Ruffo324
Ruffo324 / photo_renaiming.js
Created September 11, 2021 18:42
automatic numeric photo renaiming
data = ["Jahreszeit_Bild_2021_01.jpg"]
Jetzt brauche ich eine Funktion, die die ID also die 01 eins hochsetzt wenn ich ein neues Bild hinzufüge. Und dementsprechend bei dem nächsten dann die 02 eins weiter hoch setzt
data = ["Jahreszeit_Bild_2021_01.jpg"]
function setzeIdHoch(filename){
data.forEach(value =>{
// Vergleiche valueId mit filenameId
data.push(filenameMitNeuerId)
})
}
@Ruffo324
Ruffo324 / Hyper-V PCI-Passthroug.ps1
Last active May 2, 2024 16:56
Hyper-V PCIe passthrough CheatSheet
# Change to name of TARGET-VM.
$vm='CHANGE_ME'
# Change to PCI device location (💡 Location).
$Location = 'CHANGE_ME'
# Enable CPU features.
Set-VM -GuestControlledCacheTypes $true -VMName $vm
# Host-Shutdown rule must be changed for the VM.
Set-VM -Name $vm -AutomaticStopAction TurnOff
@Ruffo324
Ruffo324 / GitLabAddCheckAwardToDiscussions.js
Last active June 26, 2021 01:07
Add ✅ to all Discussions without any award on GitLab merge-request pages..
// Creation date: 26.06.2021. Tested with GitLab version: 14.0.0
var timer = ms => new Promise(res => setTimeout(res, ms))
var emojiButtons = [...document.querySelectorAll('.note-actions > .emoji-picker button')];
var runtimeStuff = {
stop: false,
discussions: {
withAward: 0,
withoutAward: 0
}
@Ruffo324
Ruffo324 / ConsoleCursorMovement.cs
Created June 2, 2021 02:03
Verwendet einen bereits beschriebenen Teil der Konsole wieder.. Dient eher als Beispielcode.. Der Nachteil der Lösung ist, das dass gelöschte überschrieben werden muss mit spaces ' '.. Der "richtigere" Weg würde über die manipulation des Buffers stattfinden..
#nullable enable
using System;
using System.Reactive.Disposables;
using System.Threading.Tasks;
namespace CoreCon
{
internal class Program
{
public static async Task Main()
@Ruffo324
Ruffo324 / NestedSnowballsThrower.cs
Last active April 8, 2021 16:40
Handle TryCatch inside a function example, for nested throwing?? If there would be any reason to do this??
using System;
namespace ConsoleApplication1
{
internal class Program
{
public static void Main(string[] args)
{
NestedCatching<SnowBallException>(ThrowSnowball,
() => NestedCatching<SnowBallException2>(ThrowSnowball2));
@Ruffo324
Ruffo324 / Program.cs
Last active March 11, 2021 01:20
Interval based event handling with reactive.
using System;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Timers;
namespace CoreCon
{
internal class Program
{
@Ruffo324
Ruffo324 / GitLabResolveAllIssues.js
Last active February 3, 2021 13:02
JSPageInject - GitLab resolve all discussions
// Merge-Review overview page. Open Dev Tools and paste the line below.
[...$("button[data-qa-selector='resolve_discussion_button']")]
.filter(x => !x.outerText.toLowerCase().includes("unresolve"))
.forEach(x => x.click())
@Ruffo324
Ruffo324 / FilterIFFTSkipOnDay.ts
Created February 1, 2021 20:05
IFFT Filter - Only run applet if its dark outside
/**
* IFFT Filter script, to execute an applet only if it's dark outside. Works position based.
* Just change the lat long below to your wanted location.
*/
const pos = {lat: 52.XYZ, long: 7.XYZ};
// Just placeholder for codecompletion!
// let Meta:any;
// let MakerWebhooks:any;