VirtualTam's bookmarks

  1. Context: replace spaces by dashes in a script-generated HTML file's links

    1awk -F\' 'm = /a href/ { gsub(/ /,'-',$2); print$1'\''$2'\''$3} !m {print $0}'
    
  2. Pro: no need to setup a DNS server to test virtualhosts Con: keep in mind that all "fake" hosts will point to 127.0.0.1!

    1. Use /etc/hosts to declare test hosts / domains / subdomains
    #<ip-address>	<hostname.domain.org>	<hostname>
    127.0.0.1	localhost.localdomain	localhost
    127.0.0.1	host.localdomain	host
    127.0.0.1	sub.host.localdomain	sub.host
    ::1		localhost.localdomain	localhost
    
    1. Allow per-user virtualhost definition in either (depending on your distro)
    • /etc/httpd/conf/httpd.conf
    • /etc/apache2/apache2.conf

    Include /home/albert/.httpd/*.conf

    1. Profit! Create virtualhosts with local hostnames :)
  3. Python's built-in unittest module is quite cool, but a bit limited and way too verbose (read: it's quite not easy to incite developers to write unit tests)

    I'm currently looking for more dev-friendly solutions, the key points being:

    • writing test code should be easy and straight-forward -keep the focus on "what to test" instead of "how to transcribe a process to a test"
    • parallelization! -we, spoiled developers, should make good use of our way-too-many-cores build machines...
    • complete feature set!
      • we don't want to just run tests...
      • coverage reports (find dead/weak/untested code sections)
      • output formatting (JUnit-XML seems to be quite a common format out there)

    There seem to be 3 solutions in Python:

    • stock unittest + project-dependent customizations / test helpers
    • nosetests
    • py.test

    And 2 ways of gettings things done:

    • keeping things stock: no external dependency, project-specific implementation...
    • using a test framework: one more module in your (test) virtualenv, more concise tests, more features (// run, code coverage, etc.)

    Some links:

  4. Stalactites, stalagmites, icicles and more cave stuff!

  5. 1er commandement: "Du contrôle de version, tu te soucieras" http://s3.media.squarespace.com/production/2129687/19317774/.a/6a00d8341d3df553ef017c330f2ae8970b-pi

    2ème commandement: "avec Git, tu te formeras, sinon sous SVN tu resteras" http://s3.media.squarespace.com/production/2129687/19317774/.a/6a00d8341d3df553ef017743a87369970d-pi

    3ème commandement: "Le merge, tu éviteras tant que faire se peut" http://geekandpoke.typepad.com/geekandpoke/2010/10/being-a-code-made-easy-chapter-1.html

    4ème commandement: "De versionner n'importe quoi, tu t'abstiendras" http://geek-and-poke.com/geekandpoke/2012/11/7/simply-explained.html

    5ème commandement: "Un commit réécrit, tu ne pusheras point" http://geek-and-poke.com/geekandpoke/2014/3/3/end-of-working-day

    6ème commandement: "Avant de tester, tu ne pusheras point" http://geek-and-poke.com/geekandpoke/2013/5/31/finally-its-friday

    7ème commandement: "le 6eme commandement tu appliqueras, ou ton chef te châtiera" http://geek-and-poke.com/geekandpoke/2013/11/24/simply-explained

    8ème commandement: "Tu ne tricheras point" http://geek-and-poke.com/geekandpoke/2013/7/28/tdd

    9ème commandement: ""Des tags tu abuseras" http://geek-and-poke.com/geekandpoke/2013/12/26/games-for-the-real-geeks

    10ème commandement: "Ton Dieu Jenkins tu honoreras et ton salut tu trouveras" http://geek-and-poke.com/geekandpoke/2013/8/10/the-little-miracles