Skip to content

Instantly share code, notes, and snippets.

Diego Restrepo restrepo

Block or report user

Report or block restrepo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@restrepo
restrepo / ubuntu.sh
Last active Sep 26, 2015
Ubuntu postinstall
View ubuntu.sh
#!/usr/bin/env bash
#Postinstall for Ubuntu 9.10 -- 14.04
#Install as root!
#after sudo su
echo "================================================================"
echo "Update and upgrade the system"
sudo apt-get install aptitude
sudo aptitude update
sudo aptitude -y safe-upgrade
echo "================================================================"
@restrepo
restrepo / movement.py
Created Jul 28, 2011
One dimension kinematics
View movement.py
#!/usr/bin/env python
'''one dimension kinematics
to be run from:
$ ipython -pylab
[1]: run movement.py
'''
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import sys
@restrepo
restrepo / gist:1895375
Created Feb 23, 2012 — forked from llimllib/gist:1120117
From arXiv:1107.5216
View gist:1895375
#!/usr/bin/env python
#From arXiv:1107.5216
from __future__ import division
from visual import *
craft = sphere(pos = vector(10e7,0,0), color = color.white, radius = 1e6)
Earth = sphere(pos = vector(0,0,0), color = color.blue, radius = 6.3e6)
trail = curve(color = craft.color)
G = 6.67e-11
View suttoz.c
/* Copyright (c) Colorado School of Mines, 2011.*/
/* All rights reserved. */
/* SUTTOZ: $Revision: 1.20 $ ; $Date: 2011/11/16 23:21:55 $ */
#include "su.h"
#include "segy.h"
#include "header.h"
/*********************** self documentation ******************************/
@restrepo
restrepo / dictionarize_array.py
Created May 23, 2012
Assigns a dictionary keys to the columns of a numpy array
View dictionarize_array.py
def dictionarizearray(x,list_of_columns):
"""
Assigns a dictionary key to each of the m-columns
of the (n,m) x array
EXAMPLE in some code which loads this function:
>>> names=['var1','var2',...,'varN']
>>> xnames=dictionarizearray(x,names)
>>> xmask=x[xnames['var1']<xnames['var2']]
#instead of
@restrepo
restrepo / .gitignore
Created Nov 26, 2012
GitIgnore for LaTeX Project
View .gitignore
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl
@restrepo
restrepo / master2single.py
Created Dec 4, 2012
Convert a LaTeX master file into a flatten LaTeX with all the files included
View master2single.py
#!/usr/bin/env python
"""Convert a master latex file,
into a single document by including
automatically all the LaTeX documents
which are arguments of
\include or \input
ignoring any \includeonly
"""
import sys
if len(sys.argv)==3:
@restrepo
restrepo / sed-recursive.sh
Last active Dec 11, 2015
REGEX raplacement in a list of files
View sed-recursive.sh
#!/usr/bin/env bash
pattern=$1
replace=$2
list=$3
if ! [ $replace ]; then
echo USAGE: $0 PATTERN REPLACEMENT LIST
echo EXAMPLE: $0 \""R-\\([a-z]\\+\\)"\" \"\\\$R\\\$-"\1"\" \"\*.tex\"
fi
for i in $list; do
sed 's/'"$pattern"'/'"$replace"'/g' $i > /tmp/tmpfile
@restrepo
restrepo / InformeSostebilidad.ipynb
Last active Aug 29, 2015
InformeSostebilidad.ipynb
View InformeSostebilidad.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@restrepo
restrepo / Fit_Exponential.ipynb
Last active Aug 29, 2015
Logarithmic fit.ipynb
View Fit_Exponential.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.