Skip to content

Instantly share code, notes, and snippets.

@nerewarin
nerewarin / main.py
Created October 23, 2025 16:49
Repository fetcher v3: Clean code organization, linting, and type safety
# copy of original code from https://codeshare.io/2jk6DM + fixed and prettified (but not linted yet)
# Goal: To get top-5 starred repositories from Google GitHub account (https://github.com/google/api)
#
# Result: Printed Python dictionary with top-5 repositories where key is a name of repository and value is count of stars.
# The result should be sorted in descending order
#
# Sample of potential response from github:
# [{
# "id": 1,
# "repo_name": "google_1",
@nerewarin
nerewarin / main.py
Created October 23, 2025 16:39
Repository fetcher v2: Robust error handling, logging, and CLI interface
# copy of original code from https://codeshare.io/2jk6DM + fixed and prettified (but not linted yet)
# Goal: To get top-5 starred repositories from Google GitHub account (https://github.com/google/api)
#
# Result: Printed Python dictionary with top-5 repositories where key is a name of repository and value is count of stars.
# The result should be sorted in descending order
#
# Sample of potential response from github:
# [{
# "id": 1,
# "repo_name": "google_1",
@nerewarin
nerewarin / main.py
Created September 25, 2025 19:18
Repository fetcher v2: Robust error handling, logging, and CLI interface
# copy of original code from https://codeshare.io/2jk6DM + fixed and prettified (but not linted yet)
# Goal: To get top-5 starred repositories from Google GitHub account (https://github.com/google/api)
#
# Result: Printed Python dictionary with top-5 repositories where key is a name of repository and value is count of stars.
# The result should be sorted in descending order
#
# Sample of potential response from github:
# [{
# "id": 1,
# "repo_name": "google_1",
@nerewarin
nerewarin / main.py
Created September 25, 2025 19:10
Repository fetcher: Async HTTP requests with logging and CLI
# copy of original code from https://codeshare.io/2jk6DM
# Goal: To get top-5 starred repositories from Google GitHub account (https://github.com/google/api)
#
# Result: Printed Python dictionary with top-5 repositories where key is a name of repository and value is count of stars.
# The result should be sorted in descending order
#
# Sample of potential response from github:
# [{
# "id": 1,
# "repo_name": "google_1",
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an