Skip to content

Instantly share code, notes, and snippets.

View MaximeWeyl's full-sized avatar

Maxime Weyl MaximeWeyl

View GitHub Profile
@MaximeWeyl
MaximeWeyl / settings.json
Last active August 7, 2018 09:37
VS Code Anaconda config of shell launcher
# DO NOT INCLUDE THIS COMMENT (this is not valid JSON)
# You can use this Gist to quicky setup an Anaconda workspace within VS Code on Windows
# Requirement : please first install the extension "Shell launcher" by Daniel Imms
# Usage :
# -Press Ctrl+Shift+P or F1 key to enter the VS Code prompt
# -Enter "Shell Launcher"
# -Select "Shell Launcher launch"
# -Select what you want : "Anaconda", "Git bash", or "Notebook"
{
"""
Générateur de jours ouvrés français en python
"""
def easter_date(year):
"""
Calcule la date du jour de Pâques d'une année donnée
Voir https://github.com/dateutil/dateutil/blob/master/dateutil/easter.py
:return: datetime
@MaximeWeyl
MaximeWeyl / correct_dates.py
Last active October 4, 2020 07:18 — forked from kylehowells/correct_dates.py
Automatically Corrects Insta360 Studio Snapshot Dates according to the filename.
import os
import re
import datetime
import piexif
filepath = os.path.abspath(".")
# Find files with `screenshot` in the name.
files = [f for f in os.listdir(filepath) if "screenshot" in f and f.endswith(".jpg")]
print(files)
@MaximeWeyl
MaximeWeyl / newPointer.go
Last active December 17, 2020 04:09
Golang one liner to create a pointer to a new (non zero) value
package newPointer
import "reflect"
// Just do not forget to cast it back
// Example :
// var a := getNewPointerForValue(int32(12)).(*int32)
// Uses reflection.
// Slower, but who cares. Postgres and network are the real bottleneck.
func GetNewPointerForValue(value interface{}) interface{} {