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
| Immunefi -- Security Researchers Terms & Conditions (Clickwrap | |
| Agreement) | |
| As a condition of your participation in Immunefi's Bug Bounty Programs, | |
| including the submission of bug reports, you agree to be bound by the | |
| following terms and conditions. If you do not agree to these terms and | |
| conditions you should not submit any bug report or access the Immunefi | |
| Platform for any purpose. | |
| 1. Definitions |
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
| import random | |
| def get_random_color_code(): | |
| """Generate a random ANSI color code between 31-36 (red, green, | |
| yellow, blue, magenta, cyan)""" | |
| return random.randint(31, 36) | |
| def colorize_text(text, color_code): | |
| """Apply ANSI color code to text""" | |
| return f"\033[{color_code}m{text}\033[0m" |
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
| import ast | |
| import astor | |
| class DocstringReplacer(ast.NodeTransformer): | |
| """AST Node Transformer to replace module docstring.""" | |
| def visit_Module(self, node): | |
| """Visit Module node and replace docstring.""" | |
| # Replace docstring |
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
| import xml.etree.ElementTree as ET | |
| from datetime import datetime | |
| import math | |
| import sys | |
| def parse_tcx_file(tcx_file): | |
| """Parse TCX file and return trackpoints with time and distance""" | |
| # Create namespace dictionary for TCX format | |
| ns = {'ns': 'http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2'} | |
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
| import xml.etree.ElementTree as ET | |
| from datetime import datetime, timedelta | |
| import sys | |
| def merge_tcx_activities(input_file, output_file): | |
| # Parse the input TCX file | |
| tree = ET.parse(input_file) | |
| root = tree.getroot() | |
| nspace = root.tag.split('}')[0].strip('{') |
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
| import os | |
| import xml.etree.ElementTree as ET | |
| import glob | |
| def is_in_canada(lat, lon): | |
| # Rough boundaries for Canada | |
| # Latitude: Between 41.7° and 83.1° N | |
| # Longitude: Between -141.0° and -52.6° W | |
| return (41.7 <= float(lat) <= 83.1) and (-141.0 <= float(lon) <= -52.6) |
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 github import Github | |
| # First create a Github instance using an access token | |
| g = Github("98b9ad24ffc7df18d14c9943eef3700e1b3958c5") | |
| # Then get the organization by its name | |
| org = g.get_organization("chains-project") | |
| # Then iterate over all repos in the organization | |
| for repo in org.get_repos(): |
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
| import numpy as np | |
| from sklearn.manifold import TSNE | |
| import plotly.express as px | |
| import pandas as pd | |
| import glob | |
| import json | |
| # Sample data - replace with your own dataset | |
| # data = np.random.rand(100, 20) # 100 samples, 20 features |
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
| import os | |
| from cryptography.hazmat.primitives import hashes | |
| from cryptography.hazmat.primitives.asymmetric import rsa, padding | |
| from cryptography.hazmat.primitives.serialization import ( | |
| Encoding, PrivateFormat, PublicFormat, NoEncryption | |
| ) | |
| def generate_key_pair(): | |
| """Generate an RSA key pair.""" | |
| private_key = rsa.generate_private_key( |
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
| # fully functional example of fastapi | |
| # # Create an item | |
| # curl -X POST "http://localhost:8000/items/" -H "Content-Type: application/json" -d '{"id": 1, "name": "Test Item", "price": 9.99}' | |
| # # Get all items | |
| # curl "http://localhost:8000/items/" | |
| # # Get specific item | |
| # curl "http://localhost:8000/items/1" |
NewerOlder