Skip to content

Instantly share code, notes, and snippets.

View AmirBitaraf's full-sized avatar

Amir Bitaraf AmirBitaraf

View GitHub Profile
@AmirBitaraf
AmirBitaraf / convert.py
Created April 25, 2021 14:13
Convert all subtitles in current directory to UTF-8 encoding
import os
from charset_normalizer import CharsetNormalizerMatches as CnM
for file in os.listdir("."):
if file.endswith(".srt"):
data = CnM.from_path(file).best().first().output("utf-8")
with open(file, "wb") as f:
f.write(data)
print("Wrote", file)
#!/bin/bash
ACTION=$1
ENDPOINT="https://slack.com/api/chat.command"
TOKEN="<TOKEN>"
TASK=$2
DESCRIPTION=$3
CHANNEL="<CHANNEL-ID>"
curl -X POST --data-urlencode "token=${TOKEN}" --data-urlencode "channel=${CHANNEL}" --data-urlencode "command=/jibble" --data-urlencode "text=${ACTION} ${TASK} ${DESCRIPTION}" $ENDPOINT

Keybase proof

I hereby claim:

  • I am amirbitaraf on github.
  • I am amir_bitaraf (https://keybase.io/amir_bitaraf) on keybase.
  • I have a public key ASCbWxl62jsF1RK33krfCdtNcnSkAHgBBqj9v7yCTSLalgo

To claim this, I am signing this object: