Personal collections of methods for userscripts, that may be useful for someone else...
Test to check how to construct a builder with mandatory parameters.
Pros:
- Same api as any standard builder (like Lombok)
- Will Throw a compilation error if there is a missing field.
- The compiled code (after Java's type erasure) is basically identical to a normal builder.
Cons:
These are all the scripts that I still keep on my phone for Lightning launcher (the best Android launcher ever).
If you have never heard or used this launcher, these will be useless.
If you have, and you remember me, these may look fun to check and see what crazy shenanigans I never published on the wiki.
In any case I decided to post them here for preservation. I had very little experience, I apologize for the 'unusual' style of programming.
They are unedited, shown here without any modification, they may or may not work wihout minimal tweaks.
<!-- | |
As of API 30+ package discovery is restricted, and you can't even open an url: https://developer.android.com/training/basics/intents/package-visibility#intent-signature | |
A queries tag with description of what intents you use is required, but if you don't want to be bothered this is a simple alternative. | |
This is valid queries tag that will return all packages with at least one intent. Some internal device packages won't be returned, but probably you didn't want them anyway. All the functionality from pre29 should be restored. | |
--> | |
<queries> | |
<intent> | |
<action android:name="*" /> | |
</intent> | |
</queries> |
Installation: create a bookmark with the specified url.
Opens the current page in a popup (a window without most of the browser bars). Specially usefull when you need to make a screenshot or share it live without showing your bookmarks or extensions installed.
javascript:void(window.open(window.location.href,'', 'toolbar=no'));
import colorsys | |
import hashlib | |
def uniqueColor(string): | |
""" | |
Returns a color from the string. | |
Same strings will return same colors, different strings will return different colors ('randomly' different) | |
Internal: string =md5(x)=> hex =x/maxhex=> float [0-1] =hsv_to_rgb(x,1,1)=> rgb =rgb_to_int=> int | |
:param string: input string |
Discord bot that will reply to messages that ends in one of the specific phrases of the minigame 'Fan Club' from Rythm heaven from Nintendo (https://rhythmheaven.fandom.com/wiki/Fan_Club)
Both english and spanish phrases are included, but other languajes (or any phrase) can be entered.
For example, any message that ends with ...yeah yeah yeah
will be followed by the reply:
HEY HEY HEY HEY
👏🏽👏🏽👏🏽👏🏽