Skip to content

Instantly share code, notes, and snippets.

View bastelflp's full-sized avatar

Philipp Huebner bastelflp

View GitHub Profile
@bastelflp
bastelflp / pyplot_xkcd.py
Last active November 29, 2015 18:47
Python xkcd plot
# idea from http://jakevdp.github.io/blog/2013/07/10/XKCD-plots-in-matplotlib/
# needs the font 'Humor Sans' from http://antiyawn.com/uploads/humorsans.html
# clear matplotlib font cache after font installation: %userprofile%\.matplotlib\fontList.cache
import matplotlib.pyplot as plt
import numpy as np
def main():
x = np.linspace(-4, 14, 120)
@bastelflp
bastelflp / check_version.py
Last active December 14, 2015 18:50
check python3 in one line
import sys
PY3 = sys.version_info[0] == 3
PY35 = sys.version_info[:2] == (3, 5)
@bastelflp
bastelflp / .gitconfig
Last active February 1, 2023 09:49 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool and Notepad++ for commit messages on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@bastelflp
bastelflp / pull_request_done.md
Last active March 12, 2016 16:08
What to do after pull request?

What to do after a successfull pull request?

Delete feature branch in fork remote and locally and update forked master branch.

  • Delete feature branch on GitHub via button in pull request
  • Delete feature branch locally via git branch -d <feature_branch> and remote tracked feature branch via git branch -dr origin/<feature_branch>
  • Update forked master branch via git fetch upstream and git rebase upstream/master and finally git push origin master

Read more:

@bastelflp
bastelflp / generate_dates.py
Created October 21, 2020 10:46
Generate dates with calender week
# -*- coding: utf-8 -*-
# Generate dates
# tags: py38
from datetime import date, timedelta
import locale
locale.setlocale(locale.LC_ALL, 'de_DE.utf8') # set locale for weekday abbreviation
# define time range