- Learn Python the Hard Way - Great introductory course to python and programming
- The Python Guide - After you have a cursory idea of python, this is great
- Code Like a Pythonista: Idiomatic Python - For learning the "pythonic" way of doing things
- Tango with Django - Great intro to building python web applications
- Intro to Flask, TDD, and jQuery
- Selenium's Page Object Pattern for testing websites
- The Python Yield Keyword Explained - Good precursor to the generator tricks
- Incredible guide on Python's __ (underscore) methods - Must read for anyo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import binascii, re, json, copy, sys | |
from binascii import hexlify, unhexlify | |
from bitcoin.main import * | |
# SEE https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki | |
ELECTRUM_ENG_V1_WORDLIST = [ | |
'like','just','love','know','never','want','time','out', | |
'there','make','look','eye','down','only','think','heart', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2014 Chris Cohen | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of how calculations on the secp256k1 curve work. | |
secp256k1 is the name of the elliptic curve used by bitcoin | |
see http://bitcoin.stackexchange.com/questions/25382 | |
""" | |
p = 2**256 - 2**32 - 977 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transactions: | |
504658563f231e71f79312e96da2cc13e779875ac262269b1b8f9f04e527dfc9 | |
a1faf7b6db5bb4ef4a39911ca54152df57758e128cd19fbf16178aea59e06c87 | |
b1346f1ab63dc90cb592028e1f7283f02b54e46afb35b9145ad91ac2a55877be | |
e61458c302d75b8e0925d4bb0da5466c0a76d60dce506cc766b2d3f160b1d0a5 | |
Addresses: | |
1BwJgbMKb7nz4GZ3uTDTbpovzznTrBbyJE | |
1DnJ4rzDpSG5GJsXNyXE7f17rky8wc1RLT | |
1Q6M9Vyuv5RyeuqpgJfCUCWrM2yrSb45BD |
More later...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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) |
NewerOlder