Skip to content

Instantly share code, notes, and snippets.

View MaximRouiller's full-sized avatar
🏠
Working from home

Maxime Rouiller MaximRouiller

🏠
Working from home
View GitHub Profile
@MaximRouiller
MaximRouiller / UrlToAzureStorage.py
Last active January 10, 2024 04:26
Automatically download files to Azure Blob Storage using Copy From URL API with Python
import os
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
from datetime import datetime
from urllib.parse import urlparse
# Required package: azure-storage-blob
# API Docs: https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url
now = datetime.now()
connection_string = os.getenv('AZURE_CONNECTION_STRING')
@MaximRouiller
MaximRouiller / copyUrlToAzureStorage.js
Created December 3, 2020 21:32
Automatically download files to Azure Blob Storage using Copy From URL API with node
// Required Package: @azure/storage-blob and dotenv
// API Docs: https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url
require('dotenv').config();
const { BlobServiceClient } = require('@azure/storage-blob');
const path = require('path');
let now = new Date();
const AZURE_STORAGE_CONNECTION_STRING = process.env.AZURE_STORAGE_CONNECTION_STRING;
@MaximRouiller
MaximRouiller / FunctionNames.txt
Last active October 25, 2021 14:14
Visual Studio .NET Azure Functions Regex - Name Convention
search:
\[FunctionName\("(\w+)"\)\]
replace:
[FunctionName(nameof($1))]
@MaximRouiller
MaximRouiller / UpdateModifiedDateForGitRepository.ps1
Last active August 23, 2022 15:36
Updates all the files modified date of a local clone of a git repository to reflect their actual last commit date
# Synchronously
git ls-tree -r --name-only HEAD | foreach { (Get-Item $_).LastWriteTime = [DateTime]::Parse("$(git log -1 --format="%ad" --date=iso8601 -- $_)") }
# Asynchronously
git ls-tree -r --name-only HEAD | ForEach-Object -Parallel { (Get-Item $_).LastWriteTime = [DateTime]::Parse("$(git log -1 --format="%ad" --date=iso8601 -- $_)") }