Skip to content

Instantly share code, notes, and snippets.

View SurendraTamang's full-sized avatar
🎯
Focusing

surendra SurendraTamang

🎯
Focusing
View GitHub Profile
@SurendraTamang
SurendraTamang / app.py
Created March 23, 2024 05:40
divide the large file in simple chunk zipped
import os
import zipfile
required_mb = 850
def zip_folder(folder_path, max_chunk_size_mb=required_mb):
# Convert MB to bytes for comparison
max_chunk_size = max_chunk_size_mb * 1024 * 1024
current_chunk_size = 0
chunk_num = 1
zip_file = None
@yogendratamang48
yogendratamang48 / README.md
Last active February 7, 2023 16:18
haat to squarefeet

How to run ?

>python haat.py -l 40 -b 20

@mattwang44
mattwang44 / downloadFromS3_async.py
Last active June 5, 2024 13:43
async download from AWS S3 using aiobotocore
import os
import asyncio
import aiobotocore
import io
from PIL import Image
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
@Tucker-Eric
Tucker-Eric / us_zips.csv
Last active January 18, 2024 23:48
US Zip Codes
We can't make this file beautiful and searchable because it's too large.
zip,city,state,state_abbr,county,count_code,latitude,longitude
99553,Akutan,Alaska,AK,Aleutians East,13,54.143,-165.7854
99571,Cold Bay,Alaska,AK,Aleutians East,13,55.1858,-162.7211
99583,False Pass,Alaska,AK,Aleutians East,13,54.841,-163.4368
99612,King Cove,Alaska,AK,Aleutians East,13,55.0628,-162.3056
99661,Sand Point,Alaska,AK,Aleutians East,13,55.3192,-160.4914
99546,Adak,Alaska,AK,Aleutians West,16,51.88,-176.6581
99547,Atka,Alaska,AK,Aleutians West,16,52.1224,-174.4301
99591,Saint George Island,Alaska,AK,Aleutians West,16,56.5944,-169.6186
99638,Nikolski,Alaska,AK,Aleutians West,16,52.9883,-168.7884
@tzermias
tzermias / pipelines.py
Last active March 14, 2024 23:35
Scrapy MySQL pipeline. Just a mirror to the asynchronous MySQL pipeline. Copy-paste it directly to pipelines.py. Database credentials are stored in settings.py. Based on http://snipplr.com/view/66986/
import MySQLdb.cursors
from twisted.enterprise import adbapi
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.utils.project import get_project_settings
from scrapy import log
SETTINGS = get_project_settings()