Skip to content

Instantly share code, notes, and snippets.

@kseikyo
kseikyo / cp-text-telegram.md
Created March 6, 2023 14:34
Enable text selection on telegram web
  1. Create new bookmark
  2. Name it
  3. Paste the following code in the url input
javascript: (() => {const protectedMessages = document.querySelectorAll(".is-protected"); for(const msg of protectedMessages){msg.classList.remove("is-protected");}})();

To run, just click on the bookmark in the telegram web tab.

@kseikyo
kseikyo / file.tsx
Created November 16, 2022 17:21
Fix hydration issues when using svgs - next js
// Disable ssr when importing the SVG that's causing the hydration issue
// as any is used because you'll get a type error if you try to set a property like width or height
const SVG = dynamic(() => import('path_to_svg'), {
ssr: false,
}) as any;
// Name: Merge pdfs
// Author: Lucas Sierota
// Description: Merge multiple pdfs into one
// Dependencies: pdf-lib
import "@johnlindquist/kit";
import fs from "fs/promises";
const { PDFDocument } = await npm("pdf-lib");
// Name: Merge pdfs
// Author: Lucas Sierota
// Description: Merge multiple pdfs into one
// Dependencies: pdf-lib
import "@johnlindquist/kit";
import fs from "fs/promises";
const { PDFDocument } = await npm("pdf-lib");
@kseikyo
kseikyo / command.md
Last active February 25, 2022 19:08
FFMPEG create framerate to animate video on browser

Command from this youtube comment

ffmpeg -i input.mp4 -g 4 -vcodec libx264 -profile:v main -level:v 4.1 -an -movflags faststart output.mp4
@kseikyo
kseikyo / mpv-scripts.md
Created November 23, 2021 12:30
My mpv scripts
@kseikyo
kseikyo / git-aliases.md
Last active February 4, 2022 02:25
My git aliases

Type less, work less

I've created this for my own personal use, if you find these useful or want to share your own, feel free to do it so.

Simple ones

git config --global alias.st status
git config --global alias.lg 'log --all --graph --decorate --oneline --abbrev-commit'
/**
* Issues:
* 1. Suspense does not have a fallback.
* 2. As the data is related, one Suspense should wrap them all.
* 3. Suspense is not wrapping the data fetching component.
* 4. There is no ErrorBoundary to handle a failing request.
*/
import { Suspense, useState, useEffect, ErrorBoundary } from 'react';
@kseikyo
kseikyo / dropdown.jsx
Last active July 5, 2022 12:53 — forked from bnorton/dropdown.jsx
Chameleon React Developer technical exercise
/*
Prompt:
We have defined a basic dropdown via the Dropdown and DropdownItem components below, with example usage
in the ExampleNav component. The Dropdown and DropdownItem components have some problems, and also
have room for improvements (doesn't everything?) A couple items TODO here (make sure to explain with comments!)
0. How are you today? 😊
1. Please fix any obvious issues you see with the dropdown.
2. Please then make improvements to the dropdown.