Skip to content

Instantly share code, notes, and snippets.

View DanielKotik's full-sized avatar
💭
I may be slow to respond.

Daniel Kotik DanielKotik

💭
I may be slow to respond.
View GitHub Profile
@DanielKotik
DanielKotik / .gitignore
Created December 25, 2017 11:17
.gitignore file for LaTeX projects using latexmk
## project specific files:
maindocument.pdf
## latexmk, latex, pdflatex, bibtex and other(?) auxiliary files:
*.fls
*.aux
*.glo
*.idx
*.log
*.toc
@DanielKotik
DanielKotik / .gitconfig
Created January 2, 2018 15:17
.gitconfig with useful aliases
[user]
name = ....
email = ....
[color]
ui = auto
diff = auto
status = auto
branch = auto
[push]
default = simple
@DanielKotik
DanielKotik / divtags.rst
Last active November 12, 2024 14:16
Colored note boxes inside Jupyter notebooks

############# Markdown parser in Jupyter notebooks ##################

<div class="alert alert-block alert-info"> <b>NOTE</b> Use blue boxes for Tips and notes. </div>

<div class="alert alert-block alert-success"> Use green boxes sparingly, and only for some specific purpose that the other boxes can't cover. For example, if you have a lot of related content to link to, maybe you decide to use green boxes for related links from each section of a notebook.

@DanielKotik
DanielKotik / SetMidpoint.py
Created April 19, 2018 11:01 — forked from bdjackson/SetMidpoint.py
Setting the midpoint of a matplotlib colormap
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
class MidpointNormalize(mpl.colors.Normalize):
"""
class to help renormalize the color scale
"""
def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False):
self.midpoint = midpoint
@DanielKotik
DanielKotik / UDPClient.hpp
Last active September 5, 2018 08:52 — forked from kaimallea/UDPClient.hpp
Super simple UDP client using boost
/*
This Program uses OS independet boost library 'asio'.
Below are some web links for programming UDP sockets with linux specific libraries using functions: 'gethostbyname', 'bind' and
'socket'. Please note, however, that these functions are superseded by 'getaddrinfo' and 'getnameinfo' nowadays. These functions
provide better support for IPv6.
https://www.ibm.com/developerworks/library/wa-ipv6.html
http://openbook.rheinwerk-verlag.de/linux_unix_programmierung/Kap11-016.htm#RxxKap11016040003951F04F100
https://www.cs.rutgers.edu/~pxk/417/notes/sockets/udp.html
@DanielKotik
DanielKotik / readme.md
Created August 31, 2018 11:50 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@DanielKotik
DanielKotik / gist:45763bb09332b2665686772207458d6f
Created September 3, 2018 13:02 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
# -*- coding: utf-8 -*-
"""Demonstrate high quality docstrings.
Module-level docstrings appear as the first "statement" in a module. Remember,
that while strings are regular Python statements, comments are not, so an
inline comment may precede the module-level docstring.
After importing a module, you can access this special string object through the
``__doc__`` attribute; yes, it's actually available as a runtime attribute,
despite not being given an explicit name! The ``__doc__`` attribute is also
@DanielKotik
DanielKotik / tex_directives.tex
Created June 14, 2019 09:15
Common TeX directives for various editors
% !TEX TS-program = xelatex
% !TEX encoding = utf-8
% !TEX root = ../mythesis.tex
% !TEX spellcheck = en-US % en-GB, de-DE
% !BIB TS-program = biber