Skip to content

Instantly share code, notes, and snippets.

View codeSamuraii's full-sized avatar

Rémi Héneault codeSamuraii

  • Paris, France
View GitHub Profile
@amirsoroush
amirsoroush / dataclass_vs_namedtuple_vs_normalclass.py
Created May 20, 2023 21:37
Performance comparison between dataclass & namedtuple & regular classes
from dataclasses import dataclass
from time import perf_counter
from typing import NamedTuple
class Person:
def __init__(self, first_name: str, last_name: str, age: int) -> None:
self.first_name = first_name
self.last_name = last_name
self.age = age
@ArnoldsK
ArnoldsK / reduce_video_file_size.sh
Last active January 21, 2024 10:42
Bash script for reducing a file size of a video using ffmpeg to reduce bitrate
#!/bin/bash
# Usage:
# ~$ sh reduce_video_file_size.sh [./input.mp4] [size mb] [./output.mp4]
# Parameters can be preset or set by providing none
# Input and output names must end with ".mp4"
# Can use Git Bash to run the script on Windows
display_help() {
local FILE=`basename "$0"`
import spacy
nlp = spacy.load('en') # loading the language model
data = pd.read_feather('data/preprocessed_data') # reading a pandas dataframe which is stored as a feather file
def clean_up(text): # clean up your text and generate list of words for each document.
removal=['ADV','PRON','CCONJ','PUNCT','PART','DET','ADP','SPACE']
text_out = []
doc= nlp(text)
for token in doc: