Skip to content

Instantly share code, notes, and snippets.

@mackuba
mackuba / bsky-hashtags.json
Last active June 14, 2024 20:56
Statistics of most popular hashtags on Bluesky in the last 30 days (2.6% of all posts include a hashtag)
{
"#art": 31687,
"#furryart": 21517,
"#furry": 20375,
"#nsfw": 12831,
"#1": 4572,
"#ListenToBlackVoices": 4341,
"#fursuit": 3950,
"#FogosPT": 3921,
"#ttrpg": 3378,
@jetnew
jetnew / classifier.py
Last active July 4, 2024 07:23
Super simple zero-shot text classifier using OpenAI's function calling API.
import json
import openai
openai.api_key = "sk-"
def classifier(description, labels, label_descriptions):
def classify(text):
function = {
"name": "Classify",
"description": description,
@moxak
moxak / token.py
Last active March 15, 2024 11:05
This is one to modify twint which is python module to scrape twitter without API token. In order to use, you must put this script on `twint/` and replace defalt one.
import re
import time
import requests
import logging as logme
class TokenExpiryException(Exception):
def __init__(self, msg):
super().__init__(msg)
@xloem
xloem / vtt2text.py
Last active October 9, 2023 16:17 — forked from glasslion/vtt2text.py
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@amrrs
amrrs / avoid_colab_close.js
Created August 17, 2021 20:02
How to avoid Google Colab Session Closing automatically?
//credit - https://huggingface.co/blog/fine-tune-wav2vec2-english (Patrick von Platen)
// run this on your Chrome / Browser Console (where Colab is present)
function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
var colab = setInterval(ConnectButton,60000);
>>> import spacy
>>> nlp = spacy.load("en_core_sci_lg")
>>> text = """spaCy is an open-source software library for advanced natural language processing,
written in the programming languages Python and Cython. The library is published under the MIT license
and its main developers are Matthew Honnibal and Ines Montani, the founders of the software company Explosion."""
>>> doc = nlp(text)
>>> print(doc.ents)
(spaCy, open-source software library, written, programming languages,
Python, Cython, library, MIT, license, developers, Matthew Honnibal,
Ines, Montani, founders, software company)
@willprice
willprice / KINETICS_LABELS.md
Last active June 28, 2024 11:46
Kinetics Dataset Labels (name to ID)

Kinetics Numeric/String labels

These are mapping files that go between class IDs to class names. These are generated from the training CSV files from each dataset by collecting the unique classes, sorting them, and then numbering them from 0 upwards.

@573
573 / readme.js
Created April 30, 2019 11:04
Add this bookmarklet for archive.today
javascript:void(open('http://archive.today/?run=1&url='+encodeURIComponent(document.location)))
@arsenyinfo
arsenyinfo / lut3d.py
Created April 17, 2018 14:16
Apply 3D LUT to an image. It's not optimized yet, however works as an acceptable PoC
from functools import partial
import numpy as np
from tqdm import tqdm
LUT_SIZE = 33
def _convert(pixel, lut):
r, g, b = map(lambda x: round((x / 255) * LUT_SIZE - 1), pixel)
idx = r + g * LUT_SIZE + b * (LUT_SIZE ** 2)
@milolav
milolav / Portable_WhatsApp.md
Last active July 23, 2023 12:58
Making WhatsApp desktop application portable

Portable desktop WhatsApp

You start multiple instances of WhatsApp using --user-data-dir flag providing the full path to the directory. For example:

E:\Temp\Whatsapp>WhatsApp.exe --user-data-dir=E:\Temp\Whatsapp\number1

or by creating a shortcut with the flag.