Skip to content

Instantly share code, notes, and snippets.

@wizardofozzie
wizardofozzie / wake-up-light-alarm-with-sunrise-effect.yaml
Last active November 12, 2023 06:24 — forked from peltsippi/wake-up-light-alarm-with-sunrise-effect.yaml
Home Assistant Blueprint: Wake-up light alarm with sunrise effect
blueprint:
name: Wake-up light alarm with sunrise effect
description: 'A wake-up light alarm with a brightness and color temperature sunrise
effect. Note: Requires date_time_iso sensor in configuration, not manually executable!'
domain: automation
input:
light_entity: light.bedroom_lights
name: Wake-up light entity
description: 'The light to control. Turning it off during the sunrise will keep
it off. Color temperature range is auto-detected.'
#New sierpinski fractal animation:
#Code is sloppy, I'll probably clean it up later:
# coding: utf-8
from images2gif import writeGif
from PIL import Image, ImageDraw, ImageChops
import console
  1. Learn Python the Hard Way - Great introductory course to python and programming
  2. The Python Guide - After you have a cursory idea of python, this is great
  3. Code Like a Pythonista: Idiomatic Python - For learning the "pythonic" way of doing things
  4. Tango with Django - Great intro to building python web applications
  5. Intro to Flask, TDD, and jQuery
  6. Selenium's Page Object Pattern for testing websites
  7. The Python Yield Keyword Explained - Good precursor to the generator tricks
  8. Incredible guide on Python's __ (underscore) methods - Must read for anyo
@wizardofozzie
wizardofozzie / BitStats.py
Last active October 29, 2015 00:34
BitStats.py receives new transactions from Blockchain.info and displays overall stats about them.
import websocket, thread, time, json, datetime, sys, os
def set_exit_handler(func):
if os.name == "nt":
try:
import win32api
win32api.SetConsoleCtrlHandler(func, True)
except ImportError:
version = ".".join(map(str, sys.version_info[:2]))
raise Exception("pywin32 not installed for Python " + version)
@wizardofozzie
wizardofozzie / 1_TxIds.txt
Last active September 9, 2015 13:03 — forked from brianddk/1_TxIds.txt
Check which TX confirmed on their own, and which haven't
Transactions:
504658563f231e71f79312e96da2cc13e779875ac262269b1b8f9f04e527dfc9
a1faf7b6db5bb4ef4a39911ca54152df57758e128cd19fbf16178aea59e06c87
b1346f1ab63dc90cb592028e1f7283f02b54e46afb35b9145ad91ac2a55877be
e61458c302d75b8e0925d4bb0da5466c0a76d60dce506cc766b2d3f160b1d0a5
Addresses:
1BwJgbMKb7nz4GZ3uTDTbpovzznTrBbyJE
1DnJ4rzDpSG5GJsXNyXE7f17rky8wc1RLT
1Q6M9Vyuv5RyeuqpgJfCUCWrM2yrSb45BD
@wizardofozzie
wizardofozzie / 0_Readme.md
Last active September 9, 2015 13:01 — forked from brianddk/0_Readme.md
Use PyBitcoinTools to make CPFP transaction with tip to bounty

More later...

@wizardofozzie
wizardofozzie / block_size_limit.py
Last active September 7, 2015 19:06 — forked from gubatron/block_size_limit.py
Function to propose accepted maximum block size limit in Bitcoin blockchain.
'''
Just to illustrate idea on how I believe the maximum block size should be determined.
My idea stems from a simple scalability metric that affects real users and the desire to use Bitcoin:
Waiting times to get your transactions confirmed on the blockchain.
Anything past 45mins-1 hour should be unnacceptable.
Initially I wanted to measure the mean time for the transactions in blocks to go from being sent by the user
(initial broadcast into mempools) until the transaction was effectively
confirmed on the blockchain, say for 2 blocks (acceptable 15~20mins)
@wizardofozzie
wizardofozzie / file1.py
Last active August 26, 2015 10:54 — forked from anonymous/file1.py
Pasted from IPython
#!/usr/bin/python ## JORDAN arithmetic (OLD) rather than Jacobian ## ## from .py2specials import * from .py3specials import * import binascii import hashlib import re import sys import os import base64 import time import random import hmac from bitcoin.ripemd import * # Elliptic curve parameters (secp256k1) P = 2**256 - 2**32 - 977 N = 115792089237316195423570985008687907852837564279074904382605163141518161494337 A = 0 B = 7 Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240 Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424 G = (Gx, Gy) def change_curve(p, n, a, b, gx, gy): global P, N, A, B, Gx, Gy, G P, N, A, B, Gx, Gy = p, n, a, b, gx, gy G = (Gx, Gy) def getG(): return G # Extended Euclidean Algorithm def inv(a, n): lm, hm = 1, 0 low, high = a % n, n while low > 1: r = high//low nm, new = hm-lm*r, high-low*r lm, low, hm, high = nm, new, lm, low return lm % n # JSON access
あいこくしん
あいさつ
あいだ
あおぞら
あかちゃん
あきる
あけがた
あける
あこがれる
あさい
https://torrentz.eu/0a1d873e347ae64b70b9ff2c7e9e5f29c66534cb