Skip to content

Instantly share code, notes, and snippets.

View Venipa's full-sized avatar
🏠
Working from home

Venipa

🏠
Working from home
View GitHub Profile
@Venipa
Venipa / cva-factory.ts
Created January 31, 2023 01:24
small factory for one liner components
import { cva, VariantProps } from "class-variance-authority";
import { ReactElement } from "react";
type CreateCVAProps<T> = Parameters<typeof cva<T>>;
export function createCVA<P = {}, T = any>(base?: CreateCVAProps<T>[0], config?: CreateCVAProps<T>[1]) {
const baseClassName = cva(base, config);
type cxProps = VariantProps<typeof baseClassName>;
type ComponentProps = P & cxProps;
return function (this: any, element: <P2 = {}>(prop: ComponentProps & P2 & { className: string }) => ReactElement<P, any>) {
return function (props: ComponentProps) {
return element({ ...props, className: baseClassName(props as any) });
@Venipa
Venipa / linux_curly_braces_alt_for_pwsh.ps1
Created January 28, 2023 06:32
behaviour of bash's curly braces
# yarn add example, linux: "yarn add @radix-ui/react-{...}"
("yarn add " + ("alert-dialog,collapsible,context-menu,checkbox,avatar,accordion,dialog,dropdown-menu,hover-card,navigation-menu,popover,menubar,progress,radio-group,scroll-area,select,switch,tabs,toast,toolbar,aspect-ratio".Split(",") | % { "@radix-ui/react-$_" }) -join " ") | Invoke-Expression
// ==UserScript==
// @name Twitter HTML5 Video
// @namespace https://venipa.net
// @version 0.1
// @description try to take over the world!
// @author Venipa
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @updateUrl https://gist.github.com/Venipa/74a751f64699a9a1f25b8548d1615bd6/raw/twitter-html5-player.user.js
// @grant unsafeWindow
@Venipa
Venipa / 00.convert to jpeg.c.cmd
Last active July 17, 2022 04:01
Shell-x convert images to jpeg
@echo off
for %%x in (%*) do (
echo converting %%~nxx to %%~nx.jpg
magick "%%~x" "%%~dpx\%%~nx.jpg"
)
@echo on
if %errorlevel% neq 0 pause
@Venipa
Venipa / thot_tube.user.js
Last active June 3, 2022 20:48
thot.tube bulk download unlocked images in page
// ==UserScript==
// @name ThotTube-Extended
// @namespace https://github.com/Venipa/thot-tube-userscript
// @copyright 2022, thot-tube-userscript (https://github.com/Venipa/thot-tube-userscript)
// @version 1.0.0
// @description Bridge between the desktop and webbrowser to download and merge video & audio from coub
// @author Venipa
// @match https://thot.tube/thread-*
// @connect thot.tube
// @grant none
const ensureDomLoaded = (f) => {
if (["interactive", "complete"].indexOf(document.readyState) > -1) {
f();
} else {
let triggered = false;
document.addEventListener("DOMContentLoaded", () => {
if (!triggered) {
triggered = true;
setTimeout(f, 1);
}
// ==UserScript==
// @name 9gag HTML5 Video
// @namespace https://venipa.net
// @version 0.1
// @description try to take over the world!
// @author Venipa
// @match https://9gag.com/*
// @icon https://www.google.com/s2/favicons?domain=9gag.com
// @grant unsafeWindow
// ==/UserScript==
@Venipa
Venipa / instagram-native-html5-player.user.js
Last active January 11, 2023 20:53
Instagram - Brings HTML5 native player to top layer v2
// ==UserScript==
// @name Instagram HTML5 Video
// @namespace https://venipa.net
// @version 0.1
// @description try to take over the world!
// @author Venipa
// @match https://www.instagram.com/*
// @updateURL https://gist.github.com/Venipa/f9a91ba80d2f99297cc2bd7081cc87f6/raw/e98b7d9f29e91e7fe5aef14101380b9532a0df61/instagram-native-html5-player.user.js
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant unsafeWindow
@Venipa
Venipa / dark-adonis5-docs.user.css
Last active May 16, 2021 19:18
Userstyle - Dark mode for Adonis JS 5 Docs
/* ==UserStyle==
@name Dark mode for docs.adonisjs.com
@namespace venipa.net
@version 1.0.0
@description Dark mode for Adonis JS 5 Docs
@author Venipa <admin@venipa.net>
==/UserStyle== */
@-moz-document domain("docs.adonisjs.com") {
:root {
--background-color: #101010;
const COLOR_SCHEMES = {
Adjacency6: [
"#a9a57c",
"#9cbebd",
"#d2cb6c",
"#95a39d",
"#c89f5d",
"#b1a089",
],
Advantage6: [