Skip to content

Instantly share code, notes, and snippets.

@d33bs
Created May 21, 2024 20:57
Show Gist options
  • Save d33bs/5dbe75bc2798306e608c5421d2722395 to your computer and use it in GitHub Desktop.
Save d33bs/5dbe75bc2798306e608c5421d2722395 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "aASgKPfn6ZJv",
"outputId": "c7b8d091-f61d-49f6-a74c-c8e29e01bed2"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Linux 00d2dcff3118 6.1.85+ #1 SMP PREEMPT_DYNAMIC Sun Apr 28 14:29:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux\n"
]
}
],
"source": [
"!uname -a"
]
},
{
"cell_type": "code",
"source": [
"!python --version"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "aUrCdEmx6aMQ",
"outputId": "ef8d0afc-8c07-4689-f8d9-5d5eef9b3601"
},
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Python 3.10.12\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!pip install codespell -U"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ewnl_4Pg6b3r",
"outputId": "fcec575c-5093-4866-bd0d-228aafdb7e6f"
},
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: codespell in /usr/local/lib/python3.10/dist-packages (2.2.6)\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"with open(\"not_ignored.md\", mode=\"w\", encoding=\"utf-8\") as file:\n",
" file.write(\"abandonned\")\n",
"\n",
"with open(\"ignored.md\", mode=\"w\", encoding=\"utf-8\") as file:\n",
" file.write(\"abandonned <!-- codespell:ignore -->\")"
],
"metadata": {
"id": "3em2HrOz6fca"
},
"execution_count": 4,
"outputs": []
},
{
"cell_type": "code",
"source": [
"!cat not_ignored.md"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "T42IzESF7IuX",
"outputId": "7272e8bf-cf28-43e6-f32e-55a6c0407395"
},
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"abandonned"
]
}
]
},
{
"cell_type": "code",
"source": [
"!codespell not_ignored.md"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "cHmBoZ9B68dh",
"outputId": "5d1bc08d-1558-4ae3-c086-d83aa258fadc"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[33mnot_ignored.md\u001b[0m:\u001b[33m1\u001b[0m: \u001b[31mabandonned\u001b[0m ==> \u001b[32mabandoned\u001b[0m\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!cat ignored.md"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "hD6Wagy77Lsc",
"outputId": "e68b57df-d46a-46fc-db5f-1658af77fdeb"
},
"execution_count": 7,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"abandonned <!-- codespell:ignore -->"
]
}
]
},
{
"cell_type": "code",
"source": [
"!codespell ignored.md"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "vnY7eKhn6_vg",
"outputId": "31c4944f-7332-40cc-beaa-279c17f804e5"
},
"execution_count": 8,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[33mignored.md\u001b[0m:\u001b[33m1\u001b[0m: \u001b[31mabandonned\u001b[0m ==> \u001b[32mabandoned\u001b[0m\n"
]
}
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "QmhN-_7w7BBa"
},
"execution_count": 8,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment