Skip to content

Instantly share code, notes, and snippets.

@alvarogfn
alvarogfn / useElementLineCount.ts
Created May 6, 2024 21:09
Hook que computa quantidade de linhas de um element com lineClamp
import { useEffect, useRef, useState } from 'react'
const countElementLines = (target: HTMLElement) => {
const style = window.getComputedStyle(target, null)
const fontSize = parseInt(style.getPropertyValue('font-size'))
let height = parseInt(style.getPropertyValue('height'))
const boxSizing = style.getPropertyValue('box-sizing')
if (boxSizing === 'border-box') {
@TJ-developer
TJ-developer / renew_ssl_cert.yaml
Last active May 6, 2024 21:08
Homeassistant Blueprint for SSL-Certificate renewal
blueprint:
name: Renew Let's Encrypt Certificate
description: Renew Certificate when due date is below given value
domain: automation
input:
cert_expiry_sensor:
name: Certificate Expiry Sensor
description: Sensor from the Certificate Expiry Integration (https://www.home-assistant.io/integrations/cert_expiry)
selector:
entity:
@RJ
RJ / HALJIA USB Relay Module.py
Created May 11, 2018 15:29
Python to control cheap USB relay from amazon: QinHeng Electronics HL-340 USB-Serial adapter
# To run with pyusb debugging:
#
# PYUSB_DEBUG=debug python relay.py
#
# Grab the vendor and product codes from syslog when plugging in the relay:
#
# usb 3-1: New USB device found, idVendor=1a86, idProduct=7523
#
import time
import usb.core
@nickytonline
nickytonline / settings.jsonc
Created May 5, 2024 18:25
Latest VS Code Settings
{
// miscellaneous
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"diffEditor.ignoreTrimWhitespace": false,
// window
"window.title": "🦙⚡🫡 – ${activeEditorShort}${separator}${rootName} – 🫡⚡🦙",
"window.clickThroughInactive": false,
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 6, 2024 21:03
Files for PlayStation BIOS Files NA-EU-JP
@adrianhajdin
adrianhajdin / constants.index.ts
Created October 13, 2023 10:54
Build and Deploy a Fully Responsive Modern UI/UX Website | React.js, Next.js 13, Tailwind CSS
// NAVIGATION
export const NAV_LINKS = [
{ href: '/', key: 'home', label: 'Home' },
{ href: '/', key: 'how_hilink_work', label: 'How Hilink Work?' },
{ href: '/', key: 'services', label: 'Services' },
{ href: '/', key: 'pricing ', label: 'Pricing ' },
{ href: '/', key: 'contact_us', label: 'Contact Us' },
];
// CAMP SECTION
@Haloplasm
Haloplasm / PoBs.txt
Last active May 6, 2024 21:01
Haloplasm and Seik's PoBs
----------------------------------------------
3.24 PoBs [Always re-pull PoBs right before league start to have the most updated version]
----------------------------------------------
Aurabot:
https://pobb.in/s1XzEFf8M0wi
Inquitor Spark carry:
https://pobb.in/moAh2_q-syE-
Inquisitor Storm Brand carry:
@profConradi
profConradi / chladni.py
Last active May 6, 2024 20:58
Chladni Square Plate Normal Modes Simulation
def energy(z, n, m, L):
return np.cos(n* np.pi *np.real(z) / L) *np.cos(m *np.pi*np.imag(z) / L) - np.cos(m*np.pi*np.real(z)/ L) *np.cos(n* np.pi *np.imag(z) / L)
class ChladniPlate:
def __init__(self, n, m, L=1, n_particles=10000):
self.L = L
self.n_particles = n_particles
self.n = n
self.m = m
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 6, 2024 20:57
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@Iliannnn
Iliannnn / Discord.js-v14-Events.md
Last active May 6, 2024 20:56
Discord.js v14 Events - Cheatsheet

Discord.js v14 Events

An overview of all events in Discord.js v14 with examples.

📢 | Last updated: 27 July 2022

ℹ️ | client references to your client instance.

ℹ️ | The v13 overview can be found here.