Skip to content

Instantly share code, notes, and snippets.

View vi3k6i5's full-sized avatar
πŸ‘¨β€πŸ’»
Learning...

Vikash Singh vi3k6i5

πŸ‘¨β€πŸ’»
Learning...
View GitHub Profile
@vi3k6i5
vi3k6i5 / gist:4ea37490cddf6d8b4a1daf13f6e51457
Created December 12, 2017 16:04
Compare flashtext to Trie re
import re
class Trie():
"""Regex::Trie in Python. Creates a Trie out of a list of words. The trie can be exported to a Regex pattern.
The corresponding Regex should match much faster than a simple Regex union."""
def __init__(self):
self.data = {}
def add(self, word):
@vi3k6i5
vi3k6i5 / regex_re_with_special_chars.py
Created December 12, 2017 16:23
trie regex with special characters
import re
class Trie():
"""Regex::Trie in Python. Creates a Trie out of a list of words. The trie can be exported to a Regex pattern.
The corresponding Regex should match much faster than a simple Regex union."""
def __init__(self):
self.data = {}
def add(self, word):
@vi3k6i5
vi3k6i5 / gist:907b9501238eaa99e1e59ce807698f4a
Last active September 11, 2024 12:09
Streamlit ag grid button
import datetime
import numpy as np
import pandas as pd
import streamlit as st
from st_aggrid import AgGrid, GridOptionsBuilder, JsCode, GridUpdateMode
now = int(datetime.datetime.now().timestamp())
start_ts = now - 3 * 30 * 24 * 60 * 60