Skip to content

Instantly share code, notes, and snippets.

View mttmantovani's full-sized avatar

Mattia Mantovani mttmantovani

  • TNG Technology Consulting GmbH @TNG
View GitHub Profile
@jtdp
jtdp / gist:5443297
Last active July 16, 2024 14:40
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..
@dogukancagatay
dogukancagatay / Makefile
Created June 27, 2014 18:14
Simple latex Makefile using latexmk
# Latex Makefile using latexmk
# Modified by Dogukan Cagatay <dcagatay@gmail.com>
# Originally from : http://tex.stackexchange.com/a/40759
#
# Change only the variable below to the name of the main tex file.
PROJNAME=main
# You want latexmk to *always* run, because make does not have all the info.
# Also, include non-file targets in .PHONY so they are run regardless of any
# file of the given name existing.
@bgusach
bgusach / multireplace.py
Last active July 10, 2024 14:14
Python string multireplacement
def multireplace(string, replacements, ignore_case=False):
"""
Given a string and a replacement map, it returns the replaced string.
:param str string: string to execute replacements on
:param dict replacements: replacement dictionary {value to find: value to replace}
:param bool ignore_case: whether the match should be case insensitive
:rtype: str
"""