View example.log
$ eemeter --log-level=DEBUG --log-console sample
Going to analyze the sample data set
Running a meter for ABC NATURAL_GAS_CONSUMPTION_SUPPLIED
DEBUG 2017-11-05 18:35:05,428 eemeter.ee.meter L408 | evaluate | Running meter for for trace PROJECT_ID_ABC and project ABC
DEBUG 2017-11-05 18:35:05,459 eemeter.processors.location L49 | get_weather_source | Mapped ZIP code 60640 to ISD station 997338
DEBUG 2017-11-05 18:35:05,501 eemeter.weather.noaa L25 | __init__ | Created ISDWeatherSource("997338") using cache: SqlJSONStore("sqlite:////Users/ms/.eemeter/cache/weather_cache.db")
DEBUG 2017-11-05 18:35:05,508 eemeter.weather.noaa L60 | _check_for_recent_data | ISDWeatherSource("997338") will not update 2017 data because the most recent fetch of that data occurred on 2017-11-04, which is more recent than the target date 2017-11-04.
View .gitconfig
[user]
; NOT INCLUDED IN THIS FILE TO AVOID CONFUSION. DON'T FORGET TO SET IT UP LOCALLY THOUGH :-)
[push]
default = simple
[core]
editor = vim
pager = less -F -X
[branch]
View owasp-risk-rating.html
<!-- access this at: https://cdn.rawgit.com/ErosLever/f72bc0750af4d2e75c3a/raw/owasp-risk-rating.html -->
<html><head>
<style>
#main{
width: 1200px;
}
table {
width: 98%;
font-size: small;
text-align: center;
View test_foo.py
""" Tests for `foo` package.
uses `pytest`. `pytest` resources:
* https://docs.pytest.org/en/latest/
* https://pragprog.com/book/bopytest/python-testing-with-pytest
also uses `responses`, for mocking HTTP exchanges with `requests` library:
* https://github.com/getsentry/responses
View remove_punc.py
#http://stackoverflow.com/questions/265960/best-way-to-strip-punctuation-from-a-string-in-python
import re, string
table = string.maketrans("","")
regex = re.compile('[%s]' % re.escape(string.punctuation))
def test_re(s): # From Vinko's solution, with fix.
return regex.sub('', s)
def test_trans(s):
View SanitizedString.py
""" throw your strings to SanitizedString and "ensure" they have been sanitized, such as removing control characters.
SanitizedString will avoid running redundantly, by checking type of the input (good for Very Big Strings)
>>> hello = SanitizedString(chr(0) + "hello")
>>> assert hello == "hello"
>>> assert chr(0) not in hello
>>> assert SanitizedString(hello) == hello
at time of writing there is only one sanitization filter in use:
View logging.yml
version: 1
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
verbose:
format: "%(levelname)-8s %(asctime)s %(name)s %(filename)s:%(lineno)s | %(funcName)s | %(message)s"
very_verbose:
format: "%(levelname)-8s %(asctime)s %(name)s %(pathname)s:%(lineno)s | %(funcName)s | %(message)s"
handlers:
console:
View _fix_pip_import_error.md

It can come up while installing anything really. I'm not sure exactly which versions of pip are affected, I know I had 1.5.6 and it was affected.

These examples are grabbed from my system level Python, but of course you should use a virtualenv.

  Running setup.py install for simplegeneric
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 12, in <module>
        import setuptools.version
View sonarqube and gradle and analysis mode.md

SonarQube not "uploading"? Be careful about sonar.analysis.mode=issues (or, if using Gradle, systemProp.sonar.analysis.mode=issues). This analysis mode seems required for some purposes (some plugins maybe?), but it was making Gradle not generate the report or upload it to SonarQube server. I haven't figured out the details yet but I wanted to leave this memo...

View omnifocus_solarized_light_fantastaque.ofocus-style
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>colorPalette</key>
<dict>
<key>ArchiveExpectationsBarBottomColor</key>
<dict>
<key>a</key>
<real>0.20000000000000001</real>