Skip to content

Instantly share code, notes, and snippets.

"use strict";
function initializeScript() {
return [
new host.functionAlias(findBlockers, "findblockers"),
new host.functionAlias(clrThreads, "clrthreads"),
new host.functionAlias(groupThreads, "groupthreads")
];
}
@defufna
defufna / disktest.cs
Created January 31, 2026 15:21
Test disk speed script
#:property Configuration=Release
using System.Diagnostics;
using System.Text;
var sizes = new[] { 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456 };
var configurations = new List<TestRun>();
long defaultTotalData = 256L * 1024 * 1024; // 1 GB
foreach (var size in sizes)
{
image list -f
shell dotnet-symbol /home/div0/.dotnet/shared/Microsoft.NETCore.App/9.0.0/libcoreclr.so
target symbols add /home/div0/.dotnet/shared/Microsoft.NETCore.App/9.0.0/libcoreclr.so.dbg
@defufna
defufna / tidyicon.py
Created February 21, 2025 15:23
This script automates tidying desktop icon positions in KDE Plasma.
#!/usr/bin/env python
from typing import List, Dict, Tuple
import json
from itertools import batched
import tempfile
from shutil import move
import subprocess
import time
import os
@defufna
defufna / roman.html
Created November 16, 2024 19:37
Roman
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Roman Numerals Quiz</title>
<style>
body {
display: flex;
flex-direction: column;
@defufna
defufna / Program.cs
Created June 6, 2023 17:46
Cache line contention
using System.Diagnostics;
internal class Program
{
static long[] counters;
const int timeLimit = 20 * 1000;
static void Count(int index)
{
Stopwatch sw = Stopwatch.StartNew();
while(sw.ElapsedMilliseconds < timeLimit)
code:
org 0x100
mov dx, msg
mov ah, 9
int 0x21
;get int2f dos handler
mov ax, 0x352f
int 0x21
import asciichartpy
import colorama
import subprocess
import time
import re
r = re.compile("(\d+\.?\d*)")
def get_temp():
@defufna
defufna / Main.hx
Created September 12, 2019 12:28
Deadlock on program tremination
package;
import kha.System;
import haxe.ds.Vector;
class Main {
public static function main() {
var v:Vector<Int>;
for (i in 0...8192){
// ==UserScript==
// @name Proslji
// @version 1
// @grant none
// @include https://*.slack.com/*
// ==/UserScript==
var fixit = {"proslji" : "prošli",
"prosljeg":"prošlog",
"prosljem":"prošlom",