Skip to content

Instantly share code, notes, and snippets.

@fransiska
fransiska / max.py
Created December 7, 2025 14:19
python
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from skimage import color
def visualize_vector_field_pca(vector_field):
"""
maximizes perceived variability of a 3D vector field by mapping
its principal components to the L, a, and b channels.
@fransiska
fransiska / exceljs.html
Created June 2, 2025 08:16 — forked from kemsky/exceljs.html
ExcelJS example
<html>
<head>
<title>exceljs sample</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/1.6.2/exceljs.js"></script>
<script>
function save(blob, fileName) {
var a = document.createElement("a");
document.body.appendChild(a);
@fransiska
fransiska / test.iuml
Created September 22, 2023 05:19
Plant UML
actor Actor
boundary Boundary
control Control
entity Entity
database Database
:Actor alias:
@fransiska
fransiska / gist:54875b99fa6d0e5f9a9c9fd60b9a40d4
Last active September 22, 2023 04:50
I was trying to remove opening ubuntu menu when pressing windows key but instead my left mouse went weird. It becomes grab when left clicking. Thank you for saving my sanity. https://askubuntu.com/a/1021498
# Fix left mouse click acting like a grab
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "'<Alt>'"
# Disable opening "search my computer" when clicking windows key in Ubuntu 16 by forcing the behavior of the windows key to be the same as clicking ctrl key
# https://askubuntu.com/a/206565
xmodmap -e "remove mod4 = Super_L"
xmodmap -e "add control = Super_L"
@fransiska
fransiska / compress.sh
Created May 18, 2023 00:31
Compressing pdf
# https://askubuntu.com/a/256449
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
@fransiska
fransiska / flask_blueprint.py
Last active May 8, 2020 03:14
Example for flask
from flask import Blueprint
from flask_cache import cache
from datetime import datetime
bp = Blueprint('bp', __name__)
@bp.route("/bp")
@cache.cached(timeout=50)
def index():
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
@fransiska
fransiska / flask_blueprint.py
Created May 8, 2020 01:34
Example for flask
from flask import Blueprint
from flask_cache import cache
from datetime import datetime
bp = Blueprint('bp', __name__)
@bp.route("/bp")
@cache.cached(timeout=50)
def index():
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
@fransiska
fransiska / gist:28fdbf006ed2803cfff7276e0f9cf661
Created December 10, 2019 07:41 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes: