This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set the log file path | |
| log_file="/path/to/time.log" | |
| # Get the current date and time | |
| current_date_time=$(date +"%Y-%m-%d %H:%M:%S") | |
| # Message to print | |
| message="This is a log message." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check if correct number of arguments are provided | |
| if [ $# -ne 2 ]; then | |
| echo "Usage: $0 <number_of_iterations> <command_to_be_executed>" | |
| exit 1 | |
| fi | |
| # Set the number of iterations | |
| iterations=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from eth_account import Account | |
| Account.enable_unaudited_hdwallet_features() | |
| account, mnemonic = Account.create_with_mnemonic() | |
| print(f'{account.address},{account.key.hex()},{mnemonic}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from eth_account import Account | |
| account = Account.create() | |
| print(f'{account.address},{account.key.hex()}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import random | |
| # Set the size of the image | |
| width, height = 32, 32 | |
| # Create a new image with the specified size | |
| img = Image.new('RGB', (width, height)) | |
| # Get access to the pixels of the image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| total_colors = 256 ** 3 # R * G * B | |
| f = open('colors.txt', 'w', encoding="utf-8") | |
| for x in range(total_colors): | |
| color_hex = '%06X' % x | |
| f.write(color_hex + '\n') | |
| f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function digestMessage(message) { | |
| const encoder = new TextEncoder(); | |
| const data = encoder.encode(message); | |
| const hashBuffer = await crypto.subtle.digest('SHA-256', data); | |
| const hashArray = Array.from(new Uint8Array(hashBuffer)); | |
| const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); | |
| return hashHex; | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.1.0" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getDegrees(point: CGPoint, origin: CGPoint = CGPoint.zero) -> CGFloat { | |
| let deltaX = point.x - origin.x | |
| let deltaY = point.y - origin.y | |
| let radians = atan2(deltaY, deltaX) | |
| let degrees = radians * (180.0 / CGFloat.pi) | |
| guard degrees < 0 else { | |
| return degrees | |
| } | |
NewerOlder