Skip to content

Instantly share code, notes, and snippets.

#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 */];
//{ keyboard_key
#define keyboard_key_get_code
/// keyboard_key_get_code(name:string):int
var r = keyboard_key_codes[?string_lower(argument[0])];
if (!is_undefined(r)) return r;
return -1;
#define keyboard_key_get_name
/// keyboard_key_get_name(code:int):string
var code = argument[0];
var r = keyboard_key_names[?code];
@YellowAfterlife
YellowAfterlife / gamemaker_reddit.user.js
Last active November 24, 2017 19:34
A userscript that introduces syntax highlighting for code snippets posted on /r/gamemaker
// ==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
import js.Browser.*;
import js.html.CanvasElement;
import js.html.CanvasRenderingContext2D;
import js.html.HTMLDocument;
import js.html.MouseEvent;
import sf.test.Test.Entity;
/**
* @author YellowAfterlife
* http://yal.cc/top-down-bouncing-loot-effects/
@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 */