Skip to content

Instantly share code, notes, and snippets.

View FreePhoenix888's full-sized avatar
Empty your mind, be formless, shapeless - like water

FreePhoenix888

Empty your mind, be formless, shapeless - like water
View GitHub Profile
@FreePhoenix888
FreePhoenix888 / smartphone_rom_installation_instruction.md
Last active September 12, 2024 09:15
Smartphone ROM installation instruction

Clean Flash

Warning: your data will be removed so backup it to other storage, for example your computer Warning: read the whole instruction before doing anything, especially if you do this for the first time

Unlock bootloader

I have unlocked my bootloader a lot of time ago, so I am not really able to write guide for it right now :) Google it

Install Custom Recovery (TWRP)

  • Reboot to bootloader: Use any of these methods:
    • Use this command on your computer: adb reboot bootloader
  • Press Power+Volume Down (can be different for different devices)
@FreePhoenix888
FreePhoenix888 / find_and_cat.sh
Last active July 19, 2024 11:25
Find and cat bash
find . -type f ! -path '*/.*' -exec sh -c 'printf "\n"; echo {}:; cat {}' \; > output.txt
function serialize(numbers) {
return numbers.map(num => String.fromCharCode(num)).join('');
}
function deserialize(str) {
return str.split('').map(char => char.charCodeAt(0));
}
let numbers = [1, 5, 10, 255, 300];
let serialized = serialize(numbers);
@FreePhoenix888
FreePhoenix888 / yargs-boilerplate.ts
Last active February 26, 2024 07:51
Yargs Boilerplate
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
const cliOptions = yargs(hideBin(process.argv))
.usage(`$0 [Options]`, `Description of the program`)
.options({
verbose: {
alias: "v",
description: "Enable verbose logging",
type: "boolean",
@FreePhoenix888
FreePhoenix888 / findGetCommunityPointsButtonAndClickWithInterval.js
Last active February 26, 2024 07:42
Find "Get Community Points" button and click with interval
findGetCommunityPointsButtonAndClickWithInterval();
/**
* Finds the get community points button
*/
function findGetCommunityPointsButton() {
const communityPointsContainerElement = document.body.querySelector(
".community-points-summary"
);
console.log({ communityPointsContainerElement });
@FreePhoenix888
FreePhoenix888 / find_repeating_chat_messages_and_alarm.js
Last active February 25, 2024 16:09
Find Repeating Chat Messages And Alarm
doAllWork();
/**
* Find repeating messages in the twitch chat every {@link checkIntervalInMs} milliseconds and play a sound at url {@link soundUrl} if there are more than {@link howManyMessagesMustBeUnique} unique messages in the last {@link howManyMessagesToCheck} and logs the messages if {@link shouldLog} is true and adds a stop button to the page
* @example
* ```
* workForMe()
* ```
*/
function doAllWork(
@FreePhoenix888
FreePhoenix888 / Описание Дипа.md
Last active November 15, 2023 06:27
Описание дипа

Краткое описание

Deep это:

  • Связи
  • Пакеты, содержащие связи (сам пакет это тоже связь)
  • Обработчики вставки/обновления/удаления в любой поддерживаемой среде
  • Материализованный путь связей, деревья

Связи

@FreePhoenix888
FreePhoenix888 / gist:442a7b0735dcbc8a1cb689642d5070f1
Last active August 24, 2023 07:21
create...Decorator prototype talking

Код-прототип для декоратора пакета capacitor-geolocation

import {DeepClientInstance} from '@deep-foundation/deeplinks/imports/client.js'
import { Package } from './package';

/**
 * 
 * @example
 * #### Create a decorator from another decorator
\`\`\`
// Get your token by creating one token manually and find it in Browser Developer Tools -> Network -> GenerateApiKey -> Request
const REQUEST_VERIFICATION_TOKEN = REQUEST_VERIFICATION_TOKEN;
const packages = [
...document
.querySelector('.available-packages-container')
.querySelectorAll('input'),
].map((input) => input.parentNode.textContent.trim());
for (package of packages) {
fetch('https://www.nuget.org/account/GenerateApiKey', {
headers: {
@FreePhoenix888
FreePhoenix888 / regenerate_and_copy_nuget_tokens.js
Created November 27, 2022 17:06
Regenerate and copy nuget tokens
const regenerateTokens = async ({ manageContainer }) => {
const regenerateTokenElements = [
...manageContainer.querySelectorAll('a'),
].filter((linkElement) => linkElement.textContent.trim() == 'Regenerate');
for (regenerateTokenElement of regenerateTokenElements) {
regenerateTokenElement.click();
}
prompt('Wait until all your keys regenerate to copy them properly');
};