-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnippets.json
More file actions
57 lines (57 loc) · 3.01 KB
/
snippets.json
File metadata and controls
57 lines (57 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"Yellow": {
"code": "```\ndef categorize_snippet(self, title, category):\n if title in self.data:\n self.data[title][\"category\"] = category\n self.save_data()\n print(\"Snippet category updated!\")\n else:\n print(\"Snippet not found.\")",
"category": "code",
"favorite": false,
"created_at": "2024-07-23",
"language": "unknown"
},
"Testing": {
"code": "```\nif __name__ == \"__main__\":\n main()\t",
"category": "testing",
"favorite": false,
"created_at": "2024-07-23",
"language": "unknown"
},
"New": {
"code": "```\ndef save_data(self):\n \"\"\"\n Save the current snippet data to the data file.\n \"\"\"\n with open(self.data_file, \"w\") as f:\n json.dump(self.data, f, indent=4)",
"category": "codee",
"favorite": false,
"created_at": "2024-07-23",
"language": "unknown"
},
"Newest": {
"code": "```\ndef save_data(self):\n \"\"\"\n Save the current snippet data to the data file.\n \"\"\"\n with open(self.data_file, \"w\") as f:\n json.dump(self.data, f, indent=4)",
"category": "hello",
"favorite": false,
"created_at": "2024-07-23",
"language": "unknown"
},
"Testing 2": {
"code": "```\n while True:\n print(\"\\nChoose an action:\")\n print(\"1. Add snippet\")\n print(\"2. Categorize snippet\")\n print(\"3. Search snippets\")\n print(\"4. Show all snippets\")\n print(\"5. Exit\")\n print(\"6. Toggle favorite\")\n print(\"7. Show favorite snippets\")\n print(\"8. Show contributions\") # Add new choice for contributions\n print(\"9. Delete snippet\") # Add new choice for deleting snippets\n print(\"10. Import snippets from JSON\") # Add new choice for importing snippets from JSON",
"category": "code",
"favorite": false,
"created_at": "2024-07-23",
"language": "unknown"
},
"Example Snippet 1": {
"code": "\u001b[36mprint\u001b[39;49;00m(\u001b[33m'\u001b[39;49;00m\u001b[33mHello, World!\u001b[39;49;00m\u001b[33m'\u001b[39;49;00m)\u001b[37m\u001b[39;49;00m\n",
"category": "",
"language": "python",
"favorite": false,
"created_at": "2024-07-23"
},
"Example Snippet 2": {
"code": "console.log(\u001b[33m'Hello, World!'\u001b[39;49;00m);\u001b[37m\u001b[39;49;00m\n",
"category": "",
"language": "javascript",
"favorite": false,
"created_at": "2024-07-23"
},
"Hi": {
"code": "\u001b[34mif\u001b[39;49;00m \u001b[31m__name__\u001b[39;49;00m == \u001b[33m\"\u001b[39;49;00m\u001b[33m__main__\u001b[39;49;00m\u001b[33m\"\u001b[39;49;00m:\u001b[37m\u001b[39;49;00m\n main()\u001b[37m\u001b[39;49;00m\n",
"category": "j",
"language": "python",
"favorite": true
}
}