Skip to content

Instantly share code, notes, and snippets.

View pylixonly's full-sized avatar

pylix pylixonly

  • Malaysia
  • 23:27 (UTC +08:00)
View GitHub Profile
@pylixonly
pylixonly / PremiumScreen.tsx
Last active April 1, 2025 09:40
Unpublished code for Bunny Premium™️ upselling
import { hideSheet, showSheet } from "@lib/ui/sheets";
import { createStyles } from "@lib/ui/styles";
import { NavigationNative, tokens } from "@metro/common";
import { ActionSheet, Button, PressableScale, Text } from "@metro/common/components";
import { debounce } from "es-toolkit";
import { useEffect, useLayoutEffect, useState } from "react";
import { ActivityIndicator, ScrollView, TouchableOpacity, View } from "react-native";
const showPaymentError = debounce(() => {
showSheet(
@pylixonly
pylixonly / IMPLEMENTATION.md
Last active April 4, 2025 08:21
Wintry theme proposal

A persisted store will be used to store

  • Themes/components install metadata and options (id, source URL, date installed, etc.).
  • Currently applied manifest from the last runtime

The store state would look similar to this:

{
    installedThemes: [
        {
            id: "pylixonly.winter",
@pylixonly
pylixonly / themespec.md
Last active September 17, 2024 13:02
Bunny's color spec, version 3

Extra note:

  • Color values are now required to be hex format (#RRGGBBAA)

Things to consider:

  • Allow comments JSONC, or even JSON5
  • Name conventions on id and display name
  • Read the overrideThemeContexts part
{
@pylixonly
pylixonly / proxy.md
Last active August 28, 2024 05:08
Requesting a plugin proxy in bn-plugins

Requesting a Plugin Proxy in bn-plugins

To proxy a plugin, follow the same steps as with Vendetta:

1. Ensure the original source code is public/open-source with a suitable license.
2. Build your plugin and host it publicly, such as on GitHub Pages or your own domain.
3. Post your plugin URL in the #proxy-requests channel.
4. Staff will review and update the proxy.

To streamline the review process, developers must make the following changes before requesting a proxy. These modifications make it easier to review build artifacts. If you've customized your build scripts, you can skip any unnecessary steps.

@pylixonly
pylixonly / plumper.js
Created May 26, 2023 15:56
Flattening the directory hierarchy for Plumpy
// Create a new directory called "Plumper" and dump all the files from "Plumpy" flat-ly into it
// Example: Plumpy/images/native/1.png -> Plumper/images_native_1.png
// Probably does not convert *all* but it does the most
// Packs from:
// https://github.com/acquitelol/rosiecord/tree/master/Packs/Plumpy
const fs = require("fs");
const path = require("path");
@pylixonly
pylixonly / bootstrap.js
Created January 16, 2023 12:24
Load Vendetta instead of AliucordRN
(()=>{const{externalStorageDirectory:t,restartApp:e,download:r}=nativeModuleProxy.AliucordNative,{exists:a,readFile:o}=AliuFS,d=`${t}/AliucordRN/vendetta.js`;if(a(d))return void(0,eval)(o(d,"text"));r("https://raw.githubusercontent.com/vendetta-mod/builds/master/vendetta.js",d).then(()=>e())})();
@pylixonly
pylixonly / youtubeVideoDuration.ts
Created December 27, 2022 07:55
Get the duration of a Youtube video
async getDuration(videoId: string): Promise<number> {
console.log(`Fetching duration for ${videoId}..`);
const video = await fetch(`${this.apiUrl}/videos?part=contentDetails&id=${videoId}`); // add api key params here as well
// get the first result
const [videoResult] = await video.json().then(x => x.items);
console.log(`Duration for ${videoId} is ${videoResult.contentDetails.duration}`);
// convert to seconds
@pylixonly
pylixonly / webhook.js
Created December 18, 2022 13:53
Upload static image to Discord CDN through webhooks
// upload images on discord to use through webhook avatar
// inb4 used to load images on discord but now I use application
async uploadExternalImagesFromWebhook(link: string, webhookUrl: string) {
const params = {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
avatar_url: link,
content: `<${link}>`
}),
method: "POST"