Skip to content

Instantly share code, notes, and snippets.

View restrepo's full-sized avatar

Diego Restrepo restrepo

View GitHub Profile
@restrepo
restrepo / sed-recursive.sh
Last active December 11, 2015 07:28
REGEX raplacement in a list of files
#!/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
def casasibarra(di,ranMnu=False):
"""
di.keys()-> ['MH0','MA0','Mtr01','Mtr02','Mtr03',]
"""
MH0=di['MH0'];MA0=di['MA0'];Mtr01=di['Mtr01'];Mtr02=di['Mtr02'];Mtr03=di['Mtr03']
mnu1in,Dms2,Dma2,ThetSol,ThetAtm,ThetRec=neutrino_data()
#Nupa r= min, best_fit, max
#Thesol=np.array([0.278, 0.323, 0.375])
@restrepo
restrepo / posgrado.ipynb
Last active January 29, 2016 06:40
Estudiantes de posgrado admitidos y graduados en el Instituto de Física de la UdeA desde 1995
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <Servo.h>
Servo myservo;
Servo myservo2;
const int sensor = 2;
const int ledr= 12;
const int ledv = 13;
int pos = 0;
void setup()
def Fme(x,xmin=0.996,xmax=1.005,xfit=1.001):
"""Fixing near to one values
xmin: close to 1 from below
xmax: close to 1 from above
xfit: optimized 1 limit
"""
x=np.asarray(x)
if x.shape:
x[np.logical_and(x>xmin,x<xmax)]=xfit
else:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@restrepo
restrepo / doi.ipynb
Created August 28, 2017 14:27
doi api examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@restrepo
restrepo / Least Action
Created May 16, 2014 19:21
Least Action
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@restrepo
restrepo / master2single.py
Created December 4, 2012 18:18
Convert a LaTeX master file into a flatten LaTeX with all the files included
#!/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: