Skip to content

Instantly share code, notes, and snippets.

View MarcAlx's full-sized avatar
🌱

MarcAlx MarcAlx

🌱
View GitHub Profile
@MarcAlx
MarcAlx / README.md
Last active May 7, 2024 10:23
MAUI RangeSlider
@MarcAlx
MarcAlx / GetFile.pyt
Last active April 12, 2023 14:36
Arcpy geoprocessing / web tool that outputs a file.
# -*- coding: utf-8 -*-
import arcpy
from os.path import join
class Toolbox(object):
def __init__(self):
"""Sample file toolbox"""
self.label = "Sample file toolbox"
self.alias = "File toolbox"
@MarcAlx
MarcAlx / server.py
Created September 14, 2022 09:47
local https python server with cors enabled
#!/usr/bin/env python3
from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
import sys
class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Access-Control-Allow-Origin', '*')
SimpleHTTPRequestHandler.end_headers(self)
@MarcAlx
MarcAlx / Playground.swift
Last active June 28, 2022 09:36
Apple music animated bars - SwiftUI - Swift Playground
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
var body: some View {
Bars()
}
}
struct Bars:View {
@MarcAlx
MarcAlx / Xamarin Forms libraries.md
Last active March 2, 2021 09:03
Xamarin Forms usefull libraries
@MarcAlx
MarcAlx / notification.py
Last active January 24, 2023 22:04
Send Windows notifications from python3
# -*- coding: utf-8 -*-
# Created by Marc_Alx
#
# pip install winrt
# Documentation here : https://github.com/Microsoft/xlang/tree/master/src/package/pywinrt/projection
# NB Only works with version of Windows that supports 'windows.ui.notifications'
#
# Requirements
# Windows 10, October 2018 Update or later.
# Python for Windows, version 3.7 or later
@MarcAlx
MarcAlx / Main.cs
Created January 15, 2019 17:03
Unity Scene to Equirectangular png (spherical image)
/*
* This script produces a .png image from an Unity scene.
*
* Result image looks like this : https://fr.wikipedia.org/wiki/Fichier:Paris_s%27éveille_equirectangular_panorama.jpg
*
* inspired from : https://docs.unity3d.com/ScriptReference/RenderTexture.ConvertToEquirect.html
* and https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html
*
* To use it add this script to your scene then run
*/
@MarcAlx
MarcAlx / RandomNumberGenerator.cs
Created July 8, 2018 09:53
Mersenne Twister - C#
/// <summary>
/// Random Number Generator based on Mersenne-Twister algorithm
///
/// Usage :
/// RandomNumberGenerator.Instance.Generate());
/// RandomNumberGenerator.Instance.Generate(1.1,2.2);
/// RandomNumberGenerator.Instance.Generate(1,100)
///
/// inspired from : http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/980409/mt19937-2.c
/// </summary>
@MarcAlx
MarcAlx / Usefull React - Redux links
Created May 24, 2018 19:37
Usefull React/Redux links
@MarcAlx
MarcAlx / notifications.py
Last active March 15, 2023 12:54
Send macOS notifications from python 3
#!/usr/local/bin/python3.4
# -*- coding: utf-8 -*-
# Crée par MarcAlx
import os
def displayNotification(message,title=None,subtitle=None,soundname=None):
"""
Display an OSX notification with message title an subtitle
sounds are located in /System/Library/Sounds or ~/Library/Sounds