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 / 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 -- $_)") }
@MaximRouiller
MaximRouiller / Program.cs
Last active January 17, 2023 02:58
Automatically download files to Azure Blob Storage using Copy From URL API with C#
using Azure.Storage.Blobs;
using System;
using System.IO;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
// Required .NET Package: Azure.Storage.Blobs version >=12
@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 / Program.cs
Last active March 27, 2024 22:45
GitHub API access with Personal Access Token using C# HttpClient and .NET Core
public class Program
{
public static void Main(string[] args)
{
Task.WaitAll(ExecuteAsync());
Console.ReadLine();
}
public static async Task ExecuteAsync()
{