home / system

Menu
  • GraphQL API
  • Search all tables

tools_source

Table actions
  • GraphQL API for tools_source

Data license: All Rights Reserved · Data source: krisyotam.com · About: Kris Yotam

2 rows where tool_id = 5

✎ View and edit SQL

This data as json, CSV (advanced)

id ▼ tool_id filename language content
19 slugify 5 slugify.py py #!/usr/bin/env python3 """slugify — convert text to url-safe slugs""" import re import sys import unicodedata def slugify(text: str) -> str: text = unicodedata.normalize("NFKD", text).encode("ascii", "ignore").decode() text = text.lower().strip() text = re.sub(r"[^a-z0-9\s-]", "", text) text = re.sub(r"[\s_]+", "-", text) text = re.sub(r"-+", "-", text) return text.strip("-") def main(): inp = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else input().strip() print(slugify(inp)) if __name__ == "__main__": main()
20 slugify 5 slugify.sh sh #!/bin/sh # slugify — convert text to url-safe slugs if [ -z "$1" ]; then read -r input else input="$*" fi printf '%s' "$input" \ | tr '[:upper:]' '[:lower:]' \ | sed 's/[^a-z0-9 _-]//g' \ | tr ' _' '--' \ | sed 's/--*/-/g; s/^-//; s/-$//'

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE tools_source (id INTEGER PRIMARY KEY AUTOINCREMENT, tool_id INTEGER NOT NULL, filename TEXT NOT NULL, language TEXT NOT NULL, content TEXT NOT NULL, FOREIGN KEY (tool_id) REFERENCES tools(id) ON DELETE CASCADE, UNIQUE(tool_id, language));
Powered by Datasette · 18.424ms · krisyotam.com