I hereby claim:
- I am sigmavirus24 on github.
- I am sigmavirus24 (https://keybase.io/sigmavirus24) on keybase.
- I have a public key whose fingerprint is 0161 BB7E B208 B5E0 4FDC 9F81 D9DA 0A04 9113 F853
To claim this, I am signing this object:
~/.flake8 bin/flake8 --version | |
3.0.1 (pyflakes: 1.2.3, pycodestyle: 2.0.0, mccabe: 0.5.0) CPython 2.7.11 on Darwin | |
~/.flake8 cat test.py | |
a=1 | |
~/.flake8 bin/flake8 test.py | |
test.py:1:1: E225 missing whitespace around operator |
I hereby claim:
To claim this, I am signing this object:
import decimal | |
check_state_every = decimal.Decimal('2.0') | |
spin_every = decimal.Decimal('0.2') | |
elapsed = decimal.Decimal('0') | |
while True: | |
print elapsed | |
print check_state_every | |
print (elapsed % check_state_every) |
Does writing tests and seeing them fail have you down? Add this new and improved test runner to your testing methodology and see your test runs improve.
#!/bin/sh
for ((i=0; i<$RANDOM; i++)); do echo -n '.' ; done ; echo ; echo '==== TESTS PASSED ====' ; echo 'Tests ran in 0.00s'
This one line will cure all your worries. Simply save it as a file called run_tests
and run chmod 755 run_tests
. Then whenever your tests have you down, run ./run_tests
from the command line and see green.
import github3 | |
def my_two_factor_callback(): | |
auth_code = raw_input('Please enter your 2FA code: ') | |
return auth_code | |
g = github3.GitHub() | |
g.login( | |
'sigmavirus24', | |
'fake_password', |
import os | |
os.environ['TEST_VARIABLE'] = 'Hello World!' |
from requests.packages.urllib3.filepost import encode_multipart_formdata | |
data = { | |
'form-field-0': 'value', | |
'form-field-1': 'value', | |
# ... | |
} | |
body, content_type_header = encode_multipart_formdata(fields=data) | |
r = requests.post(url, headers={'Content-Type': content_type_header}, data=body) |
with open('file') as fd: | |
requests.post(url, data=fd.read()) |
# New content |