Skip to content

Instantly share code, notes, and snippets.

View LukeberryPi's full-sized avatar

LukeberryPi LukeberryPi

View GitHub Profile
@mauvieira
mauvieira / yt-bulk-unsubscribe.js
Created January 24, 2024 01:05
YouTube Bulk Unsubscribe
// go to https://www.youtube.com/feed/channels
// paste the code and hit enter
(async () => {
const UNSUBSCRIBE_DELAY_TIME = 2000;
const runAfterDelay = (fn, delay) =>
new Promise((resolve) => setTimeout(() => resolve(fn()), delay));
import React, {Dispatch, SetStateAction, useCallback, useRef, useState} from 'react';
import {Input, TamaguiElement, XStack} from 'tamagui';
import * as Clipboard from 'expo-clipboard';
import {Keyboard} from 'react-native';
type Props = {
setState: Dispatch<SetStateAction<string>>;
};
type Code = {
defmodule LongestCommonPrefix do
@spec run([String.t()]) :: String.t()
def run(strings) do
strings
|> Stream.map(&String.graphemes/1)
|> Stream.zip_with(&Function.identity/1)
|> Stream.take_while(&all_same?/1)
|> Stream.map(&hd/1)
|> Enum.join()
end
@Grubba27
Grubba27 / calculator.ts
Created May 5, 2022 21:10
Simple calculator made in ts
type Reverse<A> =
`${A}` extends `${infer AH}${infer AT}`
? `${Reverse<AT>}${AH}` : A
type Digs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
type DigsNext<I = Digs, R = {}> =
I extends [infer Head, infer Next, ...infer Tail]
? DigsNext<[Next, ...Tail], R & Record<Head, Next>>
: { [K in keyof R]: R[K] }