Skip to content

Instantly share code, notes, and snippets.

@santiago-salas-v
santiago-salas-v / unzip_all.py
Last active December 25, 2022 23:34 — forked from kalkulus/unzip_all.py
PYTHON: unzip / unrar all files in a directory at same directory where rar file present. Remove original archive.
#!/usr/bin/python
import os, zipfile, pyunpack
basis_folder = r'C:\Users\ssv\Documents\tmp'
for root, dirs, files in os.walk(basis_folder):
for filename in files:
if filename.endswith(".rar") :
print('RAR:'+os.path.join(root,filename))
elif filename.endswith(".zip"):
print('ZIP:'+os.path.join(root,filename))
@santiago-salas-v
santiago-salas-v / get_gists.py
Last active July 14, 2023 01:29 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
# ref. selimslab/get_gists.py: git@gist.github.com:958e2255a105f9a3f4b421896bce715d.git
# ref. change_file_date_to_name_date.py: https://gist.github.com/santiago-salas-v/7f001a8d80534ebf9ec5104d409420bf
import sys
from os import walk,utime,listdir
from os.path import abspath,sep
from subprocess import call,getoutput
import json
from datetime import datetime