Skip to content

Instantly share code, notes, and snippets.

View pablohe's full-sized avatar

Pablo Echevarria pablohe

  • Universität Bremen
  • Bremen Germany
View GitHub Profile
@pablohe
pablohe / 1 GIT ejemplo práctico
Last active August 29, 2015 14:02
1 GIT ejemplo práctico
#!/bin/bash
# GIT ejemplo practico
git clone https://github.com/pablohe/ctpython.git
#Traer los cambios, si hubo
git pull ; git status
#!/usr/bin/python -tt
############ EJEMPLO 1 ############
#Don't write what code is doing, this should be left for the code to explain and can be easily done by giving class, variable and method meaningful name. For example:
t=10
#calculates square root of given number
#using Newton-Raphson method
def abc( a):
r = a / 2
#!/usr/bin/python -tt
############ EJEMPLO 2 ############
#SO SO SOLUTION
def area(x1, y1, x2, y2):
return abs(x1-x2) * abs(y1-y2)
def testArea1():
#!/bin/python -tt
import glob
import os
vamos a un lugar donde no rompamos nada
os.chdir("/tmp")
#crear 10 archivos con el nombre 1.txt, 2.txt...
sudo gedit /etc/apt/sources.list
deb http://ftp.ccc.uba.ar/pub/linux/ubuntu/ trusty main restricted universe multiverse
deb http://ftp.ccc.uba.ar/pub/linux/ubuntu/ trusty-backports main restricted universe multiverse
deb http://ftp.ccc.uba.ar/pub/linux/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://ftp.ccc.uba.ar/pub/linux/ubuntu/ trusty-security main restricted universe multiverse
deb http://ftp.ccc.uba.ar/pub/linux/ubuntu/ trusty-updates main restricted universe multiverse
sudo apt-get install python-pip
def plotear(dates, series, ax):
elements=dates.shape[-1]
recordNumbers=range(1,elements+1)
for serie in series:
mask=np.isfinite(serie.astype(np.double))
http://goo.gl/fvqJNH
program hello
print *, "Hello World!"
end program hello
#1-instalar alguna herramienta para hacer merge feliz, a mi me gusta meld
sudo apt-get install meld
#2- le dicen a git que van a usarla:
git config --global diff.tool meld
#3- llama a git para arreglar los lios
git mergetool
#les va a mostrar las versiones: local, final, remota
import string
import os
leters=string.ascii_uppercase
listCodes=zip(leters[0:17],range(0,18*3,3))
print listCodes
for item in listCodes: