Skip to content

Instantly share code, notes, and snippets.

View gwater's full-sized avatar

Josua Grawitter gwater

  • TU Berlin
  • Berlin, Germany
View GitHub Profile
@gwater
gwater / berlin_2021_wahlkreise_wahlbezirke.svg
Created October 20, 2023 11:47
Map of Berlin 2021 state election districts and subdivisions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am gwater on github.
  • I am greyage (https://keybase.io/greyage) on keybase.
  • I have a public key ASBRaRTF2GBorYeH0wV_05v4eirsswtL1is8CgyXEPYEFwo

To claim this, I am signing this object:

@gwater
gwater / unread_emails.py
Created January 11, 2021 15:43
python script to query total unread emails from multiple servers
#!/usr/bin/env python
"""
small script to check for unread count on imap inbox
"""
import imaplib
import getpass
from pykeepass import PyKeePass
def count_unread(IMAPSERVER, PORT, USER, PASSWORD):
mail = imaplib.IMAP4(
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gwater
gwater / wireframe.ipynb
Created December 14, 2018 09:56
Plots.jl wireframe animation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gwater
gwater / vector_gradient.jl
Created August 28, 2018 13:47
Jacobians using generated functions
module VectorGradient
using StaticArrays
import ForwardDiff: Dual, partials
export gradient
@generated function _partial_dual(v::T, ::Type{Val{N}}, ::Type{Val{I}}) where {T, N, I}
zs = zeros(T, N)
zs[I] = one(T)
@gwater
gwater / dynclass.py
Created October 23, 2015 13:27
Dynamically add values to a class definition in Python 3
class StaticClass:
bar = 'static output'
def __init__(self):
pass
@classmethod
def factory(cls, s):
class Dyn(cls):
foo = s
@gwater
gwater / keybase.md
Created February 8, 2015 21:41
keybase proof

Keybase proof

I hereby claim:

  • I am gwater on github.
  • I am greyage (https://keybase.io/greyage) on keybase.
  • I have a public key whose fingerprint is D2C5 7177 C384 6B0B CFC8 A2C8 1342 29B8 EF37 1A64

To claim this, I am signing this object: