A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| # Detect if executed under test | |
| TESTING = any(test in sys.argv for test in ( | |
| 'test', 'csslint', 'jenkins', 'jslint', | |
| 'jtest', 'lettuce', 'pep8', 'pyflakes', | |
| 'pylint', 'sloccount', | |
| )) | |
| if TESTING: | |
| # If testing, move the default DB to 'mysql' and replace it | |
| # with a SQLite DB. |
| // beanshell preprocessor | |
| import org.apache.commons.httpclient.auth.DigestScheme; // necessary imports | |
| import org.apache.commons.codec.binary.Base64; | |
| import org.apache.commons.codec.digest.DigestUtils; | |
| import org.apache.jmeter.protocol.http.control.Header; | |
| long timestamp = System.currentTimeMillis() / 1000L; | |
| String clientID = "***"; | |
| String clientSecret = "****"; |
| import java.util.*; | |
| import java.io.*; | |
| import java.security.*; | |
| public class ChangePassword | |
| { | |
| private final static JKS j = new JKS(); | |
| public static void main(String[] args) throws Exception | |
| { |
| #!/bin/bash | |
| # source: https://github.com/docker/toolbox/blob/master/osx/uninstall.sh | |
| # Uninstall Script | |
| if [ "${USER}" != "root" ]; then | |
| echo "$0 must be run as root!" | |
| exit 2 | |
| fi |
| What's missing on Rover's side: | |
| - top_story: this endpoint is not implemented because no info in DB. Need to talk to Mark about it. | |
| - data not completed: section, subsection, sponsor, tags. need to use the SSF's services to migrate the data | |
| DB side | |
| - [Done] query distinct | |
| - [Done] N+1 problem for postgres | |
| - [Done] postgress connection time (pgbouncer) | |
| - [Done] 50 problem for redis | |
| - [] optimize content query | |
| - [In Progress] cache machine | |
| - [] redis config | |
| Django side |