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
| <?php | |
| use Symfony\Component\HttpFoundation\File\File; | |
| use Symfony\Component\HttpFoundation\File\UploadedFile; | |
| /** | |
| * @Entity | |
| */ | |
| class Document | |
| { |
| # vi: ft=dosini | |
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = pavan.sss1991@gmail.com | |
| username = pksunkara | |
| [core] | |
| editor = nvim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| pager = delta | |
| [column] |
| sudo apt-get install unzip; | |
| wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/; |
| <?php | |
| use Symfony\Bundle\SecurityBundle\Command\InitAclCommand; | |
| use Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand; | |
| use Doctrine\Bundle\DoctrineBundle\Command\Proxy\CreateSchemaDoctrineCommand; | |
| use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; | |
| use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; | |
| require_once __DIR__.'/bootstrap.php.cache'; | |
| require_once __DIR__.'/AppKernel.php'; |
| #!/usr/bin/env python | |
| # Limitations: | |
| # - only the last sender will be shown for a given conversation with | |
| # multiple new messages | |
| # TODO | |
| # - chmod for config file | |
| # - config for every default value |
| from BaseHTTPServer import BaseHTTPRequestHandler | |
| import urlparse, json | |
| class GetHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| parsed_path = urlparse.urlparse(self.path) | |
| message = '\n'.join([ | |
| 'CLIENT VALUES:', | |
| 'client_address=%s (%s)' % (self.client_address, |
| #!/bin/bash | |
| # simple function to check http response code before downloading a remote file | |
| # example usage: | |
| # if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi | |
| function validate_url(){ | |
| if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi | |
| } |
Thanks to this article by Christoph Berg
Directories and files
~/