Skip to content

Instantly share code, notes, and snippets.

Avatar

Josua Grawitter gwater

View GitHub Profile
@gwater
gwater / unread_emails.py
Created Jan 11, 2021
python script to query total unread emails from multiple servers
View unread_emails.py
#!/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(
View IntervalRootFinding.jl animation.ipynb
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 Dec 14, 2018
Plots.jl wireframe animation
View wireframe.ipynb
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 Aug 28, 2018
Jacobians using generated functions
View vector_gradient.jl
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 Oct 23, 2015
Dynamically add values to a class definition in Python 3
View dynclass.py
class StaticClass:
bar = 'static output'
def __init__(self):
pass
@classmethod
def factory(cls, s):
class Dyn(cls):
foo = s
View keybase.md

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: