Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
YellowAfterlife / discord-compact.user.js
Created December 10, 2021 18:37
Replaces the "help" button with a button to toggle left sidebar, like so https://i.imgur.com/JsTp0pu.jpg
// ==UserScript==
// @name Discord: compact checkbox
// @namespace https://yal.cc
// @version 0.2
// @description try to take over the world!
// @author YellowAfterlife
// @match https://discord.com/*
// @grant none
// ==/UserScript==
@YellowAfterlife
YellowAfterlife / config.json
Created March 6, 2021 17:49
An example of making custom syntax extensions for GMEdit. This collapses `//hello` in a file to `//hi` in editor and back.
{
"name": "synext",
"description": "",
"scripts": ["synext.js"],
"stylesheets": []
}
(function() {
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
// default en-GB will give you DD/MM/YYYY hh:mm::ss
let dateLocales = "en-GB";
let dateOptions = undefined;
// (making it easier to restart by pasting the edited snippet)
if (window.properTimes) {
clearInterval(window.properTimes);
for (let el of document.querySelectorAll(`time:not(.proper-time)`)) {
el.classList.remove(`proper-time`);
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <SendMessage.au3>
#include <Math.au3>
;
Const $margin = 120 ; in px, how far to let stylus move outside the window bounds
Const $minWidth = 600 ; in px, minimum window width (not to require large movements for tiny windows)
Const $minHeight = 300 ; in px, minimum window height (ditto)
Const $pollRate = 5 ; in ms, lower is more likely to notice short taps
@YellowAfterlife
YellowAfterlife / raw_mouse.cpp
Last active April 13, 2019 17:35
My tweaks to multi-device polling code by Jake Stookey (http://www.jstookey.com/arcade/rawmouse/)
//================================================================
//
// raw_mouse.c - Win XP access to multiple mice via raw input
//
// To do:
//
// - Improve the method for weeding out the RDP Mouse. Find "status bits" (see below).
//
//================================================================
@YellowAfterlife
YellowAfterlife / killa.xml
Created January 22, 2019 15:07
Killa UDL for Notepad++
<NotepadPlus>
<UserLang name="Killa" ext="kia txm" udlVersion="2.0">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments" id="0">00// 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, additional" id="1"></Keywords>
<Keywords name="Numbers, prefixes" id="2">0x</Keywords>
@YellowAfterlife
YellowAfterlife / array_foreach.gml
Created September 1, 2018 10:10
Coroutine output from GMEdit
var l_ctx = argument[0];
if (!is_array(l_ctx)) {
l_ctx = array_create(6);
var l_argc = argument_count - 1;
var l_args = array_create(l_argc);
while (--l_argc >= 0) l_args[@l_argc] = argument[l_argc + 1];
l_ctx[2/* args */] = l_args;
return l_ctx;
}
var l_args = l_ctx[2/* args */];
@YellowAfterlife
YellowAfterlife / Ext.hx
Created January 5, 2017 07:26
Woes with import.hx
class Ext {
public static function test(v:Any) trace(v);
}
/// color_find(str)
// Accepts color names, "#RGB", "#RRGGBB".
var i, r, g, b, s = string_lower(argument0), hex = "012345679abcdef";
if (string_char_at(s, 1) == "#") {
i = string_length(s) - 1
s = string_copy(s, 2, i)
if (i == 3) { // #RGB
r = string_pos(string_char_at(s, 1), hex) - 1
g = string_pos(string_char_at(s, 2), hex) - 1
b = string_pos(string_char_at(s, 3), hex) - 1
@YellowAfterlife
YellowAfterlife / greenlight-stats-refresher.user.js
Created March 20, 2016 22:52
The manual tab refreshing syndrome seems a little too common.
// ==UserScript==
// @name Greenlight stats refresher
// @namespace http://yal.cc
// @version 1.0
// @description Reloads stats-tabs once per 3 minutes and displays yes-votes and comments in the tab title.
// @author YellowAfterlife
// @match http://steamcommunity.com/sharedfiles/filedetails/stats/*
// @grant none
// ==/UserScript==
/* jshint -W097 */