Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View flacle's full-sized avatar
🎯
Focusing

Francis Laclé flacle

🎯
Focusing
View GitHub Profile
@flacle
flacle / extractImagesFromPPT.py
Last active January 14, 2022 00:38
Extract images from Powerpoint presentation files.
# Author: Francis Laclé
# 13/01/2022
# Extract images from Powerpoint presentation files.
# We assume PPT(X)'s are in subdirectories and we scan one level deep.
# In case more depth is required, change the recursive flag to True on line 25.
# Objective:
# From the root directory, scan for PPT(X) files in sub directories (1-level)
# Then, for each PPT(X) open it, extract the images and save them on the disk
@lgg
lgg / README.md
Created January 6, 2022 03:00
Save SVG from HTML5 Canvas

Save SVG from Canvas

tags: Save/download/get/parse SVG image from HTML5 html web js javascript canvas

example websites: https://www.vectorizer.io/

Insert this code to JavaScript console:

var svgData = $("#outputsvg")[0].outerHTML;
var svgBlob = new Blob([svgData], {type:"image/svg+xml;charset=utf-8"});
@flacle
flacle / scene.py
Last active December 10, 2020 19:13
Manim Gradient Descent Intuition (in Papiamento)
# Manim Gradient Descent Video Intuition
# Author: Francis Laclé
# Video: https://www.youtube.com/watch?v=1cCS6uK_NH8
# Github: https://github.com/flacle
# Date: 29 Oct, 2020
from manim import *
import math
@flacle
flacle / matchHistogram.js
Last active November 1, 2021 15:39
Histogram match - Google Earth Engine
/**
* # Histogram matching
* # Google Earth Engine with S1 SAR
* # A very small experiment :D
* # Author: Francis Laclé
* # Year: 2019
*/
/**
* Function that returns a normalized image using unitScale()
@flacle
flacle / Default (OSX).sublime-keymap
Last active August 17, 2019 00:34
Quick and Dirty Python 2.7 in Sublime Text 3
[
{"keys": ["shift+ctrl+alt+b"], "command": "repl_open",
"caption": "Python2 - RUN current file",
"id": "repl_python2_run",
"mnemonic": "R",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["/Users/your-name-here/anaconda/envs/python2/bin/python", "-u", "$file_basename"],
"cwd": "$file_path",
@flacle
flacle / sortEdgeList.py
Last active September 7, 2023 07:01
Algorithm to sort edge list of simple polygon for 2D and 3D (used in Blender, coded in Python)
"""
Script to sort edge list of a simple polygon with 1 face in Blender with Python.
Something like this:
0_________3
/ \
4/ \2
\ /
5\_________/1
becomes sorted as {[4,5],[5,1],...,[0,4]}.
Tested with Blender v2.67.
@flacle
flacle / addAccentMarksForItalian.php
Last active February 13, 2016 20:07
Replaces end quotes with the appropriate accent (Italian)
<?php
/**
* The MIT License (MIT)
*
* Copyright (c) 2016 Francis Laclé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@flacle
flacle / sortRecipientsAlphabeticallyV1.scpt
Last active December 8, 2023 23:11
Apple Script for the Mail App to sort email recipients alphabetically in the To, Cc, and Bcc fields. For when you don't wan't to give subliminal preference to coworkers ;)
(*
Author: Francis Laclé
Version: 1.0
Date: January 4 2016
Description: The purpose of this script is to sort email recipients alphabetically in the To, Cc, and Bcc fields.
Motivation: For cases when you don't want to give subliminal preference to coworkers in your organization ;)
Requirements: Apple Mail, OSX El Capitan
Installation and usage:
1) Use "Run AppleScript" as a new Service in Automator.
2) Choose "Service receives no input in Mail.app".