This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://pen.org/banned-words-list/ on 5/5/2025 | |
let words = []; | |
document.querySelectorAll('td').forEach(cell => { | |
const text = cell.textContent.trim(); | |
if (text) { | |
words.push(text); | |
} | |
}); | |
words.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())); | |
console.log(words.join('\n')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>MapLibre Draw Rectangle</title> | |
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /> | |
<!-- MapLibre GL JS --> | |
<script src='https://unpkg.com/[email protected]/dist/maplibre-gl.js'></script> | |
<link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, gzip | |
def load_json(file_path): | |
try: | |
with gzip.open(file_path, 'rt', encoding='utf-8') as f: | |
return json.load(f) | |
except OSError: #if the file is not gzipped | |
with open(file_path, 'r', encoding='utf-8') as f: | |
return json.load(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydeck as pdk | |
df = pd.read_json("https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/line/heathrow-flights.json") | |
INITIAL_VIEW_STATE = pdk.ViewState(latitude=47.65, longitude=7, zoom=4.5, max_zoom=16, pitch=50, bearing=0) | |
line_layer = pdk.Layer( | |
"LineLayer", | |
df, | |
get_source_position="start", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydeck as pdk | |
import pandas as pd | |
import numpy as np | |
### sample data | |
import duckdb | |
import geopandas | |
df = duckdb.sql(f"SELECT * FROM 'geonames_23_03_2025.parquet' WHERE \"1\" = 'London' \ | |
AND \"8\" = 'GB' ").df() | |
gdf = geopandas.GeoDataFrame( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pmtiles extract https://build.protomaps.com/20250303.pmtiles OUTPUT.pmtiles --region=your_subset.geojson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set the input directory (where your PDFs are) | |
INPUT_DIR="." # Current directory, change if needed | |
# Set the output file name | |
OUTPUT_FILE="llm_ready.txt" | |
# Set the temporary directory | |
TEMP_DIR="temp_pdf_text" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
huggingface-cli login # logs in with a suitable HF token | |
huggingface-cli upload do-me/Eurovoc_English . files # all files must be in cwd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 1 -type f -name "*.webp" 2>/dev/null | sort | awk '{print NR, $0}' | while read num old_name; do new_name=$(printf "%04d.webp" "$num"); mv "$old_name" "$new_name"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import json | |
import gzip | |
# Load data | |
df = pd.read_json("your_file.json.gz") | |
# Round embeddings to 4 decimal places | |
df["embeddings"] = df["embeddings"].apply(lambda emb: [round(e, 4) for e in emb]) |
NewerOlder