entender los joins sql gráficamente

Este gráfico puede servirnos para recordar qué partes se incluyen o se excluyen en los diferentes tipos de joins:


  1. INNER JOIN
  2. LEFT JOIN
  3. RIGHT JOIN
  4. OUTER JOIN
  5. LEFT JOIN EXCLUDING INNER JOIN
  6. RIGHT JOIN EXCLUDING INNER JOIN
  7. OUTER JOIN EXCLUDING INNER JOIN





Fuente:
Visual representation of SQL joins

Use zip

The following examples illustrate typical uses of the command zip for packaging a set of files into an "archive" file, also called "zip file". The command uses the standard zip file format. The archive files can therefore be used to tranfer files and directories between commonly used operating systems. 

 zip archivefile1 doc1 doc2 doc3
This command creates a file "archivefile1.zip" which contains a copy of the files doc1, doc2, and doc3, located in the current directory. 

 zip archivefile1 *
This command creates a file "archivefile1.zip" which contains a copy of all files in the current directory in compressed form. However, files whose name starts with a "." are not included. The extension ".zip" is added by the program. 

 zip archivefile1 .* *
This version includes the files that start with a dot. But subdirectories are still not included. 

 zip -r archivefile1 .
This copies the current directory, including all subdirectories into the archive file. 

 zip -r archivefile2 papers
This copies the directory "papers", located in the current directory, into "archivefile2.zip". 

 zip -r archivefile3 /home/joe/papers
This copies the directory "/home/joe/papers" into "archivefile3.zip". Since in this case the absolute path is given, it doesn't matter what the current directory is, except that the zip file will be created there.
The command unzip extracts the files from the zip file.
 unzip archivefile1.zip
This writes the files extracted from "archivefile1.zip" to the current directory. 

git crib

Install git (debian)

sudo apt-get install git-core

Workflow

Generate SSH keys


View: https://help.github.com/articles/generating-ssh-keys

Clone a project (svn checkout equivalent)

git clone https://github.com/username/projectname.git
Creates projectname directory and clones the project.

Add a file to the repository

git add filename

Show project status

git status

Commit to the local repository

git commit -a -m "change description"

Upload to the central repository

git push git@github.com:username/projectname.git
or (see user configuration),
git push

Discard all local changes including newly added files

git reset --hard

Discard options

f you want to revert changes made to your working copy, do this:
git checkout .
If you want to revert changes made to the index (i.e., that you have added), do this:
git reset
If you want to revert a change that you have committed, do this:
git revert ...
Taken from: http://stackoverflow.com/questions/1146973/how-to-revert-all-local-changes-in-a-git-managed-project-to-previous-state

Show differences


Update project, download changes (svn update equivalent)

git pull

Show diff between master and local repository

git diff


Branches


Make a new branch

git branch rama

Show branches

git branch

Go to the branch rama

git checkout rama

Merge with master

git branch master (goto the main branch)
git merge "rama" (merge rama with main)


User configuration


User

To automate the pulls:

View the reponame
git config -l

And then
sudo git config remote.origin.url https://{USERNAME}:{PASSWORD}@github.com/{USERNAME}/{REPONAME}.git

Find all *.pyc and remove from the repository

find . -name "*.pyc" -exec git rm -f {} \;

Ignore some types of files (global)

git config --global core.excludesfile ~/.gitignore_global

Edit ~/.gitignore_global and add patterns like *.pyc

Ignore some types of files (local)

At the local repository edit .gitignore and add patterns.

Chuleta de git

## Branques