Skip to content

Instantly share code, notes, and snippets.

View bibixx's full-sized avatar

Bartosz Legięć bibixx

View GitHub Profile
@bibixx
bibixx / IH-K663.yaml
Created December 26, 2024 15:12
Zigbee 2 MQTT
blueprint:
name: IH-K663 Tuya Smart Bottom
description: >
This blueprint is designed for the IH-K663 Tuya Smart Button, allowing you to configure actions for different button press types using MQTT integration.
Define actions for single, double, and long presses to control various devices and scenes in your smart home setup.
domain: automation
input:
mqtt_device:
name: MQTT Device
description: The MQTT device to trigger the automation.
@bibixx
bibixx / index.ts
Created August 9, 2024 05:43
Promise.allObject
type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
type AwaitedObject<T> = { [key in keyof T]: Awaited<T[key]> };
interface PromiseConstructor {
allObject: <T extends object>(obj: T) => Promise<Prettify<AwaitedObject<T>>>;
}
@bibixx
bibixx / arc.sh
Created July 23, 2024 21:30
Change Arc's Icon (for free)
#!/bin/bash
# Function to re-enable cursor
enable_cursor() {
tput cnorm
}
# Trap to ensure cursor is re-enabled on exit
trap enable_cursor EXIT
@bibixx
bibixx / dollar.js
Created June 7, 2024 08:09
dollar.js
function $(selector, parent = document) {
return parent.querySelector(selector);
}
function $$(selector, parent = document) {
return Array.from(parent.querySelectorAll(selector));
}
@bibixx
bibixx / LICENSE.md
Last active December 14, 2023 16:09
FaviconX • Fix x.com favicon

The MIT License (MIT)

Copyright © 2023 Bartosz Legięć

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

@bibixx
bibixx / README.md
Last active March 14, 2024 22:42
WDI 2024 iCal Generator
@bibixx
bibixx / crypto-pbkdf2.js
Last active October 14, 2022 22:26 — forked from chrisveness/crypto-pbkdf2.js
Uses the SubtleCrypto interface of the Web Cryptography API to hash a password using PBKDF2, and validate a stored password hash against a subsequently supplied password. Note that both bcrypt and scrypt offer better defence against ASIC/GPU attacks, but are not available within WebCrypto.
/**
* Returns PBKDF2 derived key from supplied password.
*
* Stored key can subsequently be used to verify that a password matches the original password used
* to derive the key, using pbkdf2Verify().
*
* @param {String} password - Password to be hashed using key derivation function.
* @param {Number} [iterations=1e6] - Number of iterations of HMAC function to apply.
* @returns {String} Derived key as base64 string.
*
@bibixx
bibixx / irez.js
Created November 23, 2021 17:20
Kod PKP...
// Source: https://bilet.intercity.pl/irez/js/irez.js
// JavaScript Document
function escape_frame()
{
if (window != top)
{
alert(location.href);
top.location.href = location.href+'?checkJS=true';
}
@bibixx
bibixx / script.js
Created May 23, 2021 19:37
Unfollow all users on twitter
// Unfollow all users on twitter
// Created by [@bibixx](https://github.com/bibixx)
(async function () {
class Error429 extends Error {}
const sleep = (t) => new Promise((r) => setTimeout(r, t));
const sleepCountdown = async (time, interval) => {
const arr = Array.from({ length: time / interval }).map(
// ==UserScript==
// @name Add normal styling for SDKP
// @version 0.1.1
// @author bibixx
// @match https://sdkp.pjwstk.edu.pl/html/*
// @icon https://external-content.duckduckgo.com/ip3/www.pja.edu.pl.ico
// @grant none
// ==/UserScript==
(function() {