Skip to content

Instantly share code, notes, and snippets.

View beatobongco's full-sized avatar

Beato Bongco beatobongco

View GitHub Profile
@beatobongco
beatobongco / scrape.js
Created September 3, 2019 09:30
Scraping a webpage via console
// Create an interval which will keep scrolling downwards
const interval = setInterval(() => {
window.scrollTo(0, document.body.scrollHeight)
}, 250)
// If there are no more items, you can call `clearInterval(interval)` to stop scrolling
// Now copy the below code to scrape data and download a file containing the data
;(() => {
// Define a function to scrape elements we want
@beatobongco
beatobongco / ML_Links.md
Created October 3, 2019 02:46
Awesome links to get started with machine learning!
@beatobongco
beatobongco / replace.py
Last active May 13, 2022 08:20
Replace non-english sentences
import re
import math
import enchant
d = enchant.Dict("en_US")
def replace_noneng_sents(text: str, replace_with_spaces=True,
split_regex=r"[\.\。\!\?\?]",
clean_regex=r"[^a-zA-Z\']",
threshold=0.5,
debug=False) -> str: