Skip to content

Instantly share code, notes, and snippets.

@yig
yig / qpsolver.h
Last active September 23, 2024 16:21
A tiny Eigen OSQP wrapper.
#pragma once
/*
Description: A tiny Eigen OSQP wrapper.
Author: Yotam Gingold <yotam (strudel) yotamgingold.com>
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/)
On GitHub as a gist: https://gist.github.com/yig/f8fb55fc37dbc11c4fc60cbca77b7dc7
*/
#include <Eigen/Dense>
@yig
yig / parametric_shape.py
Created April 11, 2024 16:03
A port of "Retrieval on Parametric Shape Collections" [Schulz et al. 2017]'s public code release to Python.
# A port of "Retrieval on Parametric Shape Collections" [Schulz et al. 2017]'s public code release to Python.
# Project website: <https://people.csail.mit.edu/aschulz/paramShapeRetrieval/index.html>
# This code was created by manually correcting the output of ChatGPT.
import numpy as np
class ParametricShape:
EPSILON_CONST = 1e-7
def __init__(self, filename=None, nParameters=None, defaultParameters=None, triangles=None,
@yig
yig / lch_histo.py
Last active March 26, 2024 13:50
Make an Lch histogram from an image. Try `lch_histo.py --wheel` and then `lch_histo.py --histofancy image.png wheel.png`.
#!/usr/bin/env python3
'''
Author: Yotam Gingold <yotam (strudel) yotamgingold.com>
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/)
On GitHub as a gist: https://gist.github.com/yig/2de8f832b96f6ddffd788bb9c3e72ccf
'''
## pip install scikit-image drawsvg
@yig
yig / sig2text.py
Last active October 25, 2024 03:53
Converts a PDF file assumed to be a two-column ACM or CGF article to text. Ignores reviewer red numbering.
'''
# Author: Yotam Gingold <[email protected]>
# License: CC0
# URL: <https://gist.github.com/yig/d55eba6221997d12d94fe6976a357edd>
## About
Converts a PDF file assumed to be a two-column ACM article to text. Ignores reviewer red numbering.
## Install
@yig
yig / autonirf.py
Last active July 17, 2024 10:26
Download 2023 data from the Indian Ministry of Education (MoE) National Institute Ranking Framework (NIRF) for all categories
## All the categories on <https://www.nirfindia.org/2023/Ranking.html>
## pip install requests beautifulsoup4
## Author: Yotam Gingold <[email protected]>
## License: CC0
## URL: <https://gist.github.com/yig/bc29935d22845dc02bf5000bcf18ba25>
# from pathlib import Path
import csv
import os
@yig
yig / feedgen.py
Last active December 20, 2023 03:12
Create a valid podcast RSS feed from a base URL and a list of files.
#!/usr/bin/env python3
'''
Author: Yotam Gingold <yotam (strudel) yotamgingold.com>
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/)
On GitHub as a gist: https://gist.github.com/yig/4784a86c1343d2bed789dd243ce980fc
'''
'''
Example:
@yig
yig / simplepalettes.py
Last active May 1, 2023 21:59
Generate palette swatches, one random and one following a template. Can also generate uniform color wheels in Lab/Luv space via `python3 simplepalettes.py --wheel -L 60 -c 33 triad foo`.
#!/usr/bin/env python3
'''
Author: Yotam Gingold <yotam (strudel) yotamgingold.com>
License: Public Domain [CC0](http://creativecommons.org/publicdomain/zero/1.0/)
On GitHub as a gist: https://gist.github.com/yig/3d2a68232554df3b76509438ebba2106
'''
from __future__ import print_function, division
@yig
yig / seam_edges.h
Last active July 15, 2021 11:08
Finds all UV-space boundaries of a mesh.
// Copyright (C) 2016 Yotam Gingold <[email protected]>
// GitHub Gist: https://gist.github.com/yig/bea834b6e5262490611cdb4470a2f34c
/*
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
@yig
yig / index.html.py
Last active October 15, 2020 14:06
Make a simple, static index.html for a directory listing the files and their sizes.
#!/usr/bin/env python3
# Author: Yotam Gingold <[email protected]>
# License: Public Domain (CC0)
# URL: https://gist.github.com/yig/e59eaa22f5042320ecf18a87da4e44ae
from pathlib import Path
def make_index_html( path ):
path = Path(path)
@yig
yig / zoom-defang.sh
Last active September 11, 2023 11:54
Defang the macOS Zoom Installer. Extracts a .app that can be dragged to /Applications.
#!/bin/sh
## Author: Yotam Gingold
## License: CC0 (public domain) https://creativecommons.org/share-your-work/public-domain/cc0/
## URL: https://gist.github.com/yig/af5bbb054bb9c4de39abc9156e6863e1/
## Download the latest Zoom installer.
echo "==> Downloading the latest Zoom installer."
cd ~/Downloads
## Intel: