CodeSnippets
Home
Pricing

© 2024 CodeSnippets. Making code sharing simpler.

Discover and Share
Code Snippets

Explore high-quality code snippets, learn best practices, and share your knowledge with the developer community

Language Filter
Loading language options...
#
Popular Tags
Loading tag options...

Node.js File Reading and Writing Examples

The Node.js File System (fs module) is a crucial component of the Node.js core API. It provides func...

JavaScript
29
#Node.js#File
CodeSnippets
14 days ago

SQL Filtering and Sorting Data

Retrieve data from a table that meets specific criteria and sort it by a certain field. This SQL cod...

SQL
25
#SQL Sorting
CodeSnippets
16 days ago

STM32 IO Operation (LED Lighting)

The following is a simple STM32 program example that uses the HAL library to light up an LED.

C
37
#STM32#LED
CodeSnippets
18 days ago

Python Remove Duplicates from List of Dicts

Remove duplicates from a list of dictionaries based on a specific key in the dictionaries.

Python
28
#dict#deduplicate
CodeSnippets
2025年10月3日

Python Merge Two Dicts with Overwrite

Merge two dictionaries, where the latter overwrites the same keys of the former.

Python
14
#dict
CodeSnippets
2025年10月3日

Python Download File from URL using Requests

Use the requests library to download files from a URL and save them locally.

Python
14
#requests#download
CodeSnippets
2025年10月3日

Python Flatten List of Lists Unique

Flatten a 2D list (list of lists) into a 1D list and remove duplicate elements.

Python
16
CodeSnippets
2025年10月3日

Python Get Yesterday Date String

Get yesterday's date in Python and output it as a string.

Python
11
#datetime
CodeSnippets
2025年10月3日

Python: Write Dict to CSV with Headers

Write a list of dictionaries to a CSV file and automatically generate headers.

Python
10
#dict#csv
CodeSnippets
2025年10月3日

Python: Read JSON Line by Line

Read JSONL (JSON Lines) files line by line in Python, suitable for processing large-scale datasets.

Python
12
#json#jsonl
CodeSnippets
2025年10月3日

Bash Check If File Exists and Not Empty

In Bash scripts, it is often necessary to check if a file exists and is not empty.

Shell
14
#bash#scripting+1
CodeSnippets
2025年10月3日

Python Read Nested JSON File Example

How to read JSON files with nested structures in Python and safely access deep-level fields.

Python
14
#json#nested
CodeSnippets
2025年10月3日