VirtualTam's bookmarks

  1. Given your unittests are in the tests directory:

     1# run a specific test module
     2python -m unittest tests.<module>
     3 
     4# run a specific test suite
     5python -m unittest tests.<module>.<class>
     6 
     7# run a specific test
     8python -m unittest tests.<module>.<class>.<test>
     9 
    10# run tests matching a given pattern
    11python -m unittest discover -s tests -p <pattern>
    
  2. electric-indent has been activated by default in emacs 24

    to disable it for Python: (add-hook 'python-mode-hook (lambda () (set (make-local-variable 'electric-indent-functions) (list (lambda (arg) 'no-indent)))))

  3. Very cool & detailed tutorial on how to setup Emacs for Python editing, completion & execution.

    https://github.com/jhamrick/emacs

  4. 2015-01-16
  5. To import a certificate to a Java keystore:

    $ keytool -import -alias <alias> -file <file>.crt -keystore <keystore>

    Example (Linux w/ OpenJDK 7):

    $ /usr/lib/jvm/java-7-openjdk-amd64/bin/keytool -import -alias <alias> -file <file>.crt -keystore /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts

  6. To increase the memory allocated and available:

    1# /etc/default/jenkins
    2JAVA_ARGS='Xms4G -Xmx16G -Djava.awt.headless=true'
    

    See also

  7. 2015-01-06
  8. DIsplay code coverage stats

  9. Includes support for Coverage, Xunit and other cool stuff ;-) Oh, and there is parallel testing, too \o/

    nosetests --with-coverage --cover-erase --cover-tests --cover-html --cover-html-dir=htmlcov --with-xunit --xunit-file=unit.xml

    via http://www.alexconrad.org/2011/10/jenkins-and-python.html

  10. "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."

    The opposite is WET:

    We
    Edit
    Terribly, Tumultuously, Tempestuously, Tenaciously, Too much, Timidly, Tortuously, Terrifiedly... 
    

    > I think WET also stands for "We Enjoy Typing" // DuncanBayne