Skip to content

Instantly share code, notes, and snippets.

View jmetzz's full-sized avatar
🚴
always having fun

Jean Metz jmetzz

🚴
always having fun
View GitHub Profile
Add your title here - keep under 50 characteres
This change addresses: [JIRA Ticket]
Why:
* Reason 1
* Reason ...
# 50-character subject line

Compress pdf files

I was looking for a good enough solution to compress pdf files, one which I could use to create scripts and automate some tasks.

Buy a Pdf Compressor license for use once per year is not an option for.

Luckly there exists GhostScript.

So, if you have GhostScript installed in your machine it is pretty easy to compress some files without losing too much quality.

Keybase proof

I hereby claim:

  • I am jmetzz on github.
  • I am jeanmetz (https://keybase.io/jeanmetz) on keybase.
  • I have a public key whose fingerprint is 75AE CCB7 F37D 276E 0425 D2DE 0C56 7125 1EBC 494F

To claim this, I am signing this object:

#! /usr/bin/env bash
brew install coreutils
# Upgrade git and install related apps
sudo mv /usr/bin/git /usr/bin/git-apple
brew install git
brew link --force git
brew install git-flow diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
FROM continuumio/miniconda3
LABEL maintainer "Jean Metz"
RUN conda install -c conda-forge jupyter ipywidgets jupyterlab \
numpy scipy pandas scikit-learn scikit-image \
matplotlib seaborn statsmodels plotly pillow
RUN jupyter serverextension enable --py jupyterlab
# Expose Jupyter port & cmd
#!/usr/bin/env bash
function usage {
echo "$0 [options] <conda environment file>"
echo
echo " Options:"
echo " -h shows this message"
echo
echo
}
@jmetzz
jmetzz / utilities.py
Created January 9, 2019 10:45
Load and register a set of classes from a python package
import importlib
import inspect
import logging
import pkgutil
import six
from typing import Text, List, Dict, Any
class Action(object):
@jmetzz
jmetzz / log_utils.py
Created January 9, 2019 10:15
python color log configuration
def configure_colored_logging(loglevel):
import coloredlogs
field_styles = coloredlogs.DEFAULT_FIELD_STYLES.copy()
field_styles['asctime'] = {}
level_styles = coloredlogs.DEFAULT_LEVEL_STYLES.copy()
level_styles['debug'] = {}
coloredlogs.install(
level=loglevel,
use_chroot=False,
fmt='%(asctime)s %(levelname)-8s %(name)s - %(message)s',
@jmetzz
jmetzz / .bash_profile
Created October 25, 2016 14:41
add the git branch name on the prompt next to the path
#add this info to get the git branch name on the prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@jmetzz
jmetzz / .gitconfig
Last active April 11, 2024 15:01
My git config
[user]
name = Your name
email = your.email@domain.com
[alias]
# List branches
br = branch
# Commit changes
ci = commit