Skip to content

Instantly share code, notes, and snippets.

View raselcse07's full-sized avatar
🎯
Focusing

Rasel Miah raselcse07

🎯
Focusing
View GitHub Profile
#! /usr/bin/python3
import os
import random
import urllib.request
def create_or_get_directory(dirName):
'''
I will create a directory to store
def get_image_ext(filepath):
'''
This function will check the file
extensions.If there is no file extensions,
then it will provide ".jpg" as default.
'''
base_name = os.path.basename(filepath)
name, ext = os.path.splitext(base_name)
if ext == "":
ext = ".jpg"
def downloader(image_url):
# Generate random numbers from 1 to 10000
randnumber = random.randrange(1,10000)
# Get the images extention
name, ext = get_image_ext(image_url)
# Full image name
images_name = str(randnumber) + ext
def main(filename):
try:
file = open(filename,"r") # Open the file with read mode
images_url = file.readlines()
for i in images_url:
downloader(i) # Downloading ...
file.close()
return True # Successfully downloaded
except IOError:
return False # File does not exists
@raselcse07
raselcse07 / swift6.2_migration_adoption.md
Last active September 18, 2025 14:58
swift6.2_migration_adoption
Task Strategy
Enable defaultIsolation(MainActor.self) (or similar) Try in a small module first, see how many warnings drop or relevant behaviour changes.
Use @concurrent for functions that can truly run off the actor Be careful: concurrency changes may expose data races if shared mutable state isn’t protected.
Replace uses of unsafe pointers or buffer manipulation with Span / safer APIs where possible Especially in embedded / systems code.