Skip to content

Instantly share code, notes, and snippets.

Vadim ‮oknehcayD YellowAfterlife

View GitHub Profile
View discord-proper-time.js
(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`);
View wacom-auto-map.au3
#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 Apr 13, 2019
My tweaks to multi-device polling code by Jake Stookey (http://www.jstookey.com/arcade/rawmouse/)
View raw_mouse.cpp
//================================================================
//
// 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 Jan 22, 2019
Killa UDL for Notepad++
View killa.xml
<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 Sep 1, 2018
Coroutine output from GMEdit
View array_foreach.gml
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 Jan 5, 2017
Woes with import.hx
View Ext.hx
class Ext {
public static function test(v:Any) trace(v);
}
View color_find.gml
/// 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 Mar 20, 2016
The manual tab refreshing syndrome seems a little too common.
View greenlight-stats-refresher.user.js
// ==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 */
@YellowAfterlife
YellowAfterlife / gamemaker_doc.user.js
Created Jan 31, 2016
Syntax highlighting for GameMaker: Studio' online manual.
View gamemaker_doc.user.js
// ==UserScript==
// @name GameMaker Manual' highlighting
// @namespace http://yal.cc
// @include http://docs.yoyogames.com/source/*
// @author YellowAfterlife
// @description Various improvements for GameMaker' manual ~ http://yellowafterlife.itch.io/gamemaker-manual-hinting
// @version 1.001
// @grant none
// ==/UserScript==
// built-in keywords:
@YellowAfterlife
YellowAfterlife / gamemaker_reddit.user.js
Last active Nov 24, 2017
A userscript that introduces syntax highlighting for code snippets posted on /r/gamemaker
View gamemaker_reddit.user.js
// ==UserScript==
// @name /r/gamemaker syntax highlighting
// @namespace https://yal.cc
// @include http://www.reddit.com/r/gamemaker/*
// @include https://www.reddit.com/r/gamemaker/*
// @author YellowAfterlife
// @description Syntax highlighting for /r/gamemaker ~ http://yellowafterlife.itch.io/syntax-highlighting-for-gamemaker-reddit
// @license https://creativecommons.org/licenses/by-nc-sa/3.0/
// @version 1.100
// @grant none
You can’t perform that action at this time.