Skip to content

Instantly share code, notes, and snippets.

@jap
jap / doorbell.yaml
Last active June 16, 2023 00:32
esphome powered imperial march doorbell
---
# writtten by Jasper Spaans,
# based on https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/
esphome:
name: doorbell_v2
platform: ESP8266
board: esp01
# WiFi connection, correct these
# with values for your WiFi.
wifi:
@jap
jap / d1
Created July 4, 2018 08:39
zdb -mmm
Metaslabs:
vdev 0
metaslabs 144 offset spacemap free
--------------- ------------------- --------------- -------------
metaslab 0 offset 0 spacemap 264 free 47.1G
segments 18060 maxsize 65.3M freepct 73%
In-memory histogram:
12: 756 **********
13: 611 ********
@jap
jap / COPYING
Created January 17, 2017 07:44
This is a very simple script to slowly corrupt directories. Use at your own peril.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jap
jap / keybase.md
Created January 9, 2015 12:57
Keybase proof

Keybase proof

I hereby claim:

  • I am jap on github.
  • I am jap (https://keybase.io/jap) on keybase.
  • I have a public key whose fingerprint is 3777 9041 41FC A92A BFBC 6B13 D84E F7E7 2ABE AD61

To claim this, I am signing this object:

Base = declarative_base()
def __Base__repr__(self):
"""A usable repr for objects from the declarative_base hierarchy"""
atts = []
for key in self.__table__.c.keys():
if key in self.__dict__:
if not (hasattr(self.__table__.c.get(key).default, 'arg') and
getattr(self.__table__.c.get(key).default, 'arg') == getattr(self, key)):
atts.append( (key, getattr(self, key)) )
Verifying myself: My Bitcoin username is +jap. https://onename.io/jap
@jap
jap / pmp.py
Created May 15, 2013 15:42
Poor man's profiler
# Poor man's profiler
# (c) 2013 Jasper Spaans, covered by the WTFPL [wtfpl.org]
import collections
import signal
import threading
import time
local_context_stack = threading.local()