jueves, 3 de julio de 2014

Hide Keyboard iOS when user touch outside the textboxes

Add this code inside the ViewController:

 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event  
 {  
   // Hide keyboard if user touch the screen  
   [[self view] endEditing:YES];  
 }  

source

viernes, 25 de abril de 2014

Install git subtree Ubuntu/Linux

  1. Checkout the git source as we need to get to the contrib directory. There will be no need to compile git itself.
  2. Instide a shell go into the git/contrib/subtree directory.
  3. Run make to prepare subtree.
  4. The Makefile makes some assumptions about where git will be installed that aren't correct for ubuntu. So, running make install will show an error. Instead run sudo install -m 755 git-subtree/usr/lib/git-core to install subtree.
  5. Remove the git source (unless you want to keep it around for another reason).


Source

martes, 1 de abril de 2014

Tips to write a beautiful and useful README.md file


  • Title and subtitles:
    • Title starts with #
    • Subtitle starts with ##
    • SubSubTitle starts with ###
    • SubSubSub...N starts with {#}n
 # Title  
 Explain   
   
 ## Sub Title  
 This is other content related to Title  
   
 ### Sub Title  
 This is a content related to Sub Title  
   
 ## SubSubTitle  
 This is other content related to Title  

  • Show a beautiful Json content use "```json" and the begining and  "```" at the end:
 ```json  
 {  
   something:'Yeah',  
   other:'Oh Yeah!',  
  }  
 ```  
   
  • If you put 4 spaces behind the content it will be showed in a separated box.
  • For multiple items use '-', '*' or '.' at the begining of the lines.
 - This is the first one  
 - This is the second one  
  • Use '`' to open and close a grey rectangle over a variable, path or something you want to show. If you write`PATH_IMAGES`... will be draw something like:
 PATH_IMAGES

martes, 28 de enero de 2014

File Upload Django simple example

Project tree

A basic Django 1.3 project with single app and media/ directory for uploads.
minimal-django-file-upload-example/
    src/
        myproject/
            database/
                sqlite.db
            media/
            myapp/
                templates/
                    myapp/
                        list.html
                forms.py
                models.py
                urls.py
                views.py
            __init__.py
            manage.py
            settings.py
            urls.py

1. Settings: myproject/settings.py