Skip to content

Instantly share code, notes, and snippets.

View clauswrm's full-sized avatar

Claus Martinsen clauswrm

View GitHub Profile
@clauswrm
clauswrm / grain.svg
Created October 8, 2020 08:56
Grainy Noise SVG
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 clauswrm on github.
  • I am clauswrm (https://keybase.io/clauswrm) on keybase.
  • I have a public key ASCC2DKG_8JNLLfUhetpAWEM8zExQ1Ve8SapB28Kc2bb_go

To claim this, I am signing this object:

@clauswrm
clauswrm / progress.py
Created February 17, 2020 15:51
Simple progress bar with ETA and itrs/sec
from time import time
from math import ceil
prev_time = 0.0
def progress(total: int, current: int, steps=20):
""" Displays a progress bar with time information. """
itrs_per_step = ceil(total / steps)
@clauswrm
clauswrm / how_to_sign_commits_with_gpg_in_intellij_idea_on_windows.md
Created April 18, 2018 14:38
Steps to enable signing commits with GPG in IntelliJ IDEA on Windows

How to sign commits with GPG in IntelliJ IDEA on Windows

If anyone is having trouble commiting and pushing signed commits in IntelliJ IDEA (or any other JetBrains IDE) like me, here are the steps:

This guide assumes that you have [generated a GPG key added it to your GitHub account][github_sign_gpg].

Signing commits in IntelliJ

  1. Let Git use the pin entry app which comes with gpg4win:
def sean_paul(levels=0): return 'Sean %s Paul' % ('"' + sean_paul(levels=levels - 1) + '"') if levels > 0 else 'Sean Paul'
@clauswrm
clauswrm / group_finder.py
Created November 18, 2017 12:56
Counting dots by finding clusters of 1's in binary matrices.
def groupify(binary_matrix):
"""
Finds all distinct groups of 1's in a 2x2 binary matrix
:param binary_matrix: A 2x2 binary matrix
:type binary_matrix: list
:return: A matrix with all nodes, arranged in a disjoint set forest
:rtype: list
"""