Skip to content

Instantly share code, notes, and snippets.

@Csqhi515
Csqhi515 / github-sort-reactions.user.js
Last active November 22, 2024 17:12
A userscript that sorts comments by reaction. Some fixes. And button to load more automatically
// ==UserScript==
// @name GitHub Sort Reactions
// @version 0.2.17
// @description A userscript that sorts comments by reaction
// @license MIT
// @author Rob Garrison
// @namespace https://github.com/Mottie
// @match https://github.com/*
// @run-at document-idle
// @grant GM_addStyle
@Csqhi515
Csqhi515 / CompactWSL.bat
Created October 18, 2024 17:35
Script to help compact WSL and vhdx.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
wsl sudo fstrim --all; echo "Exit status: $?";
@Csqhi515
Csqhi515 / HypervOff.bat
Last active October 18, 2024 14:48
Enable or disable Hyper-V.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
if "%*"=="" (powershell -Command "Start-Process '%~f0' -Verb RunAs") else (powershell -Command "Start-Process '%~f0' -ArgumentList '%*' -Verb RunAs")
exit /b
)
:: To check if Hyper-V is active, run 'systeminfo' in the command prompt.
@Csqhi515
Csqhi515 / CompactVHD.bat
Created October 18, 2024 12:31
Script to compact vhd/vhdx.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
if "%*"=="" (powershell -Command "Start-Process '%~f0' -Verb RunAs") else (powershell -Command "Start-Process '%~f0' -ArgumentList '%*' -Verb RunAs")
exit /b
)
if [%1]==[] (
//Displays csgoexo pricelist
function wsGet() {
const socket = new WebSocket('wss://csgoexo.com/socket.io/?EIO=3&transport=websocket');
socket.addEventListener('message', function (event) {
if (event.data.indexOf('["pricelist"') > -1) {
priceListHandler(event.data);
socket.close();
}
});
}
// ==UserScript==
// @name Trade1 - csgoexo.com
// @namespace Scripts
// @match https://csgoexo.com/
// @grant none
// @version 1.0
// @description
// ==/UserScript==
(() => {
//Get all items for data object
import os
import csv
import glob
# Script to parse all csv files in folder and output the number of files in which each value in target column exists. And it can count files in subfolders and make columns for them in output.
# Simply put this where the csv files are and fire away.
# Some config
import os
import csv
import glob
# Script to parse csv, count txn of each address and sort and save to file.
# Place a csv file next to this program
# Config
<?php
//Main solution begins
/**
* The custom comparison function handed to usort
*/
function sort_fn($a, $b)
{
//sort by menuText and fallback to catDesc