Skip to content

Instantly share code, notes, and snippets.

@tsh-code
tsh-code / du.sh
Created May 18, 2019 13:55
Find largest modules
du -sh ./node_modules/* | sort -nr | grep '\dM.*'
@alaminfirdows
alaminfirdows / Bengali.php
Created July 9, 2019 13:02
Laravel Bangla Date, Time and Number
<?php
class Bengali
{
// Numbers
public static $bn_numbers = ["১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০"];
public static $en_numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
// Months
public static $en_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
public static $en_short_months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
@yuezhu
yuezhu / haproxy.cfg
Last active May 6, 2024 21:14
HAProxy config for HTTPS transmission web interface
global
maxconn 16384
log 127.0.0.1 len 8192 local0
log-send-hostname
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
@primaryobjects
primaryobjects / m3u8.md
Last active May 6, 2024 21:14
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@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