Skip to content

Instantly share code, notes, and snippets.

View maximtrp's full-sized avatar

Maksim Terpilovskii maximtrp

View GitHub Profile
@Te-k
Te-k / pdf_metadata.md
Created November 26, 2020 10:31
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - > some.cleaned.pdf
@papr
papr / gaze_with_offset_correction.py
Created August 31, 2020 12:59 — forked from pfaion/gaze_with_offset_correction.py
Offset Corrected Gaze From Recording
from pyglui import ui
import file_methods as fm
import player_methods as pm
from gaze_producer.gaze_producer_base import GazeProducerBase
from methods import denormalize
from player_methods import transparent_circle
class GazeFromRecordingWithOffsetCorrection(GazeProducerBase):
@amintos
amintos / btm.py
Created May 2, 2017 13:42
Bi-term Topic Model implementation in pure Python
"""
Bi-Term Topic Model (BTM) for very short texts.
Literature Reference:
Xiaohui Yan, Jiafeng Guo, Yanyan Lan, and Xueqi Cheng:
"A biterm topic model for short texts"
In Proceedings of WWW '13, Rio de Janeiro, Brazil, pp. 1445-1456.
ACM, DOI: https://doi.org/10.1145/2488388.2488514
This module requires pre-processing of textual data,
@cs224
cs224 / pyjags_rain_sprinkler_grass_simple_bayesian_network.py
Last active October 27, 2022 17:57
Simple Bayesian Network via Monte Carlo Markov Chain in PyMC3
import math
import pyjags
import numpy as np
import pandas as pd
np.random.seed(0)
np.set_printoptions(precision=3)
def pyjags_trace():
@sans-serif
sans-serif / README.md
Last active March 29, 2022 09:43
[Awesome WM] Random, unique Wallpaper for every tag

Random, unique Wallpaper for every tag in awesome wm

Awesome version >= 3.5

About

This is a way to get a random and unique wallpaper for every tag (or rather the last selected tab, since multiple tags can be selected) in the awesome window manager. The wallpapers are selected randomly from a provided path (which should only contain suitable pictures) and the algorithm guarantees a unique wallpaper for every tag.

Where to place

In the config file for awesome wm, which should be located at

@alimuldal
alimuldal / nemenyi.py
Last active May 25, 2020 09:39
Implementation of Nemenyi's multiple comparison test, following a Kruskal-Wallis 1-way ANOVA
import numpy as np
from scipy import stats
from itertools import combinations
from statsmodels.stats.multitest import multipletests
from statsmodels.stats.libqsturng import psturng
import warnings
def kw_nemenyi(groups, to_compare=None, alpha=0.05, method='tukey'):
"""
@alimuldal
alimuldal / dunn.py
Last active October 5, 2023 06:04
Implementation of Dunn's multiple comparison test, following a Kruskal-Wallis 1-way ANOVA
import numpy as np
from scipy import stats
from itertools import combinations
from statsmodels.stats.multitest import multipletests
from statsmodels.stats.libqsturng import psturng
import warnings
def kw_dunn(groups, to_compare=None, alpha=0.05, method='bonf'):
"""