Skip to content

Instantly share code, notes, and snippets.

@tinyapps
tinyapps / ytdlp_nest_comments.py
Last active August 9, 2024 17:41 — forked from pukkandan/ytdlp_nest_comments.py
Convert YouTube comments from an info.json file (acquired via yt-dlp --write-comments) to HTML.
#!/usr/bin/env python3
"""
Forked and modified from pukkandan/ytdlp_nest_comments.py:
https://gist.github.com/pukkandan/ee737fec64822f2552caf3ca4cbf5db7
which included this license and copyright information:
"SPDX-License-Identifier: MIT https://opensource.org/licenses/MIT
Copyright © 2021 pukkandan.ytdlp@gmail.com"
Convert YouTube comments from an info.json file (acquired via
@velzie
velzie / manifest-v2-chrome.md
Last active September 17, 2024 09:29
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

AWSTemplateFormatVersion: 2010-09-09
Description: Template which deploys a basic VPC with a single SG, 2 public subnets and an IGW. Optionally can also deploy 2 private subnets and a NAT gateway
Parameters:
Subnet1AzParameter:
Type: AWS::EC2::AvailabilityZone::Name
Description: First subnet avalibility zone
Subnet2AzParameter:
Type: AWS::EC2::AvailabilityZone::Name
Description: Second subnet avalibility zone
@hyperupcall
hyperupcall / settings.jsonc
Last active September 19, 2024 16:20
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@thatrand0mnpc
thatrand0mnpc / custom_traceback_example.py
Last active August 1, 2022 21:22
Python custom traceback
import linecache
import re
import sys
from types import TracebackType
from typing import Any, Dict, List, Optional
PACKAGE_PATH_PATTERN = r'.*/lib/python.*/site-packages/.*'
class TracebackLogger:
#!/usr/bin/env python
"""Extend Python's built in HTTP server to save files
curl or wget can be used to send files with options similar to the following
curl -X PUT --upload-file somefile.txt http://localhost:8000
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt
__Note__: curl automatically appends the filename onto the end of the URL so
@hhsprings
hhsprings / zip2tar.go
Last active August 4, 2024 11:57
unpacking/repacking zip written by Golang
package main
import (
"archive/zip"
"archive/tar"
"compress/gzip"
//"compress/bzip2" // bzip2 package of standard library in Go 1.16 has no compression ability.
"github.com/dsnet/compress/bzip2"
"fmt"
"io"
@david-mcdonagh
david-mcdonagh / aws-kms-client.go
Last active November 22, 2023 11:30
Go client to search KMS Keys in multiple profiles and mark keys that have tag ResourceIdentifier for deletion 'go run wd-aws-client.go <--dry-mode (optional> <profile_name> ...
package main
import (
"context"
"fmt"
"log"
"os"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
@pukkandan
pukkandan / ytdlp_nest_comments.py
Last active August 9, 2024 17:41
Prettify and nest comments from yt-dlp's info.json file and write it to a new html/json file
#!/usr/bin/env python3
"""
SPDX-License-Identifier: MIT https://opensource.org/licenses/MIT
Copyright © 2021 pukkandan.ytdlp@gmail.com
* Input file is an info.json (with comments) that yt-dlp (https://github.com/yt-dlp/yt-dlp) wrote
* Change FIELDS according to your needs