Skip to content

Instantly share code, notes, and snippets.

@hippietrail
hippietrail / fetch-youtube-transcript.ts
Last active September 21, 2025 11:18
TypeScript code to fetch one or more YouTube transcripts as plain text without API key
import url from 'url';
import parse from 'html-dom-parser';
import { Element, Text } from 'domhandler';
import { decodeXML } from 'entities';
async function getHtmlByVideoID(videoID: string): Promise<string> {
const reponse = await fetch(url.format({
protocol: 'https',
hostname: 'www.youtube.com',
@aguscontreras
aguscontreras / Github-bg-colors.toml
Created March 16, 2023 23:44
Starship presets - Github dark color palette
format = """
[ 🐞 ](bg:#171A1D fg:#171A1D)\
[](bg:#ea4a5a fg:#171A1D)\
$directory\
[](fg:#ea4a5a bg:#fb8532)\
$git_branch\
$git_status\
[](fg:#fb8532 bg:#34d058)\
$nodejs\
$rust\
import SwiftUI
import WebKit
import Combine
class WebViewData: ObservableObject {
@Published var loading: Bool = false
@Published var scrollPercent: Float = 0
@Published var url: URL? = nil
@Published var urlBar: String = "https://nasa.gov"
@balloob
balloob / panel-redirect.js
Created June 22, 2020 04:51
Add redirects to the Home Assistant sidebar to any place in Home Assistant
/*
Add a link to the sidebar to any path in Home Assistant
Put this file in <config>/www/panel-redirect.js
In configuration.yaml:
panel_custom:
- name: panel-redirect
# url_path needs to be unique for each panel_custom config
@Mau5Machine
Mau5Machine / docker-compose.yml
Last active July 17, 2025 20:13
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@kvvoff
kvvoff / tuyadimmer_lightoutput.h
Created September 18, 2019 17:47 — forked from placidorevilla/tuyadimmer_lightoutput.h
Prototype esphome component for Tuya Dimmer
#pragma once
#include "esphome.h"
using namespace esphome;
enum TuyaCmd : uint8_t {
HEARTBEAT = 0x00,
QUERY_PRODUCT = 0x01,
MCU_CONF = 0x02,
WIFI_STATE = 0x03,
@brunofbrito
brunofbrito / apps_install.sh
Last active December 15, 2024 23:17
Install my macOS apps with homebrew, cask and mas-cli
#!/bin/zsh
echo Time to install all apps at once!
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Installing Homebrew...
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo Installing Oh My Zsh...
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@bleft
bleft / UIButton+Extension.swift
Last active March 12, 2021 19:04
UIButton with centered Image and Text
// with the help of: https://gist.github.com/phpmaple/9458264
extension UIButton {
func centerImageAndButton(_ gap: CGFloat, imageOnTop: Bool) {
guard let imageView = self.imageView,
let titleLabel = self.titleLabel else { return }
let sign: CGFloat = imageOnTop ? 1 : -1;
let imageSize = imageView.frame.size;
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 1, 2025 05:06 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@theychx
theychx / cc-play.py
Last active May 28, 2018 08:50
Script that pushes url to a Chromecast, and then remains in foreground until playback has completed. Requires PyChromecast>=0.8.0.
#! /usr/bin/env python3
import os
import signal
import sys
import tempfile
import threading
import pychromecast