Skip to content

Instantly share code, notes, and snippets.

View marcelino-m's full-sized avatar

Marcelo M. A. marcelino-m

View GitHub Profile
@marcelino-m
marcelino-m / gist:2ca638c06460a065e88edf6218c26704
Created January 11, 2018 06:10 — forked from drorata/gist:b05bfd59c45eec0470f6
Nice output of pandas.DataFrame in org-mode
import pandas as pd
import numpy as np
from tabulate import tabulate

df = pd.DataFrame(np.random.random((4,3)), columns=['A','B','C'])
print("foo")
return(tabulate(df, headers="keys", tablefmt="orgtbl"))
@marcelino-m
marcelino-m / interpolate.R
Created December 18, 2017 05:44 — forked from andrie/interpolate.R
Interpolation and smoothing functions in R
# Generate data in the form of a sine wave
set.seed(1)
n <- 1e3
dat <- data.frame(
x = 1:n,
y = sin(seq(0, 5*pi, length.out = n)) + rnorm(n=n, mean = 0, sd=0.1)
)
approxData <- data.frame(
@marcelino-m
marcelino-m / nginx.conf
Created August 3, 2017 04:16
Nginx conf for a dockerize ng2 app and setup proxy
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@marcelino-m
marcelino-m / myorg-nginx.conf
Last active September 24, 2018 07:26
Example of a nginx conf using Let's Encrypt
# Virtual Host configuration for myorg.cl
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/myhost.myorg.cl/fullchain.pem;
@marcelino-m
marcelino-m / tcoord_dmh.py
Last active April 24, 2020 22:04
Transformacion de coordenadas DMH
import pyproj
def utm2dmh(x, y):
"""Transformacion coordenadas WGS84/UTM 19S a DMH"""
a1 = 1.01340872464667
b1 = 0.000356424618826433
c1 = -509325.431674420
a2 = -0.00134028501767773
b2 = 1.00293580527335
@marcelino-m
marcelino-m / celda_propuesta_fromato_csv_to_json.js
Last active June 6, 2017 17:19
Prpuesta para formato de celda al leer el input csv de georeferenciacion
celda = {
fase:"",
banco:"",
nombre:"",
identificador:number,
vcelda: [
{
x:1,
y:2,
@marcelino-m
marcelino-m / Dockerfile-dbschema
Last active May 10, 2017 16:09
Dbschema in docker
# Run as :
# docker run -it --rm -e DISPLAY=$DISPLAY --net=host -v /tmp/.X11-unix:/tmp/.X11-unix container-name
FROM debian:stretch
RUN apt-get -y update && apt-get install -y
ENV HOME /home/dbschema
ENV USER dbschema
@marcelino-m
marcelino-m / tcoord_mlp.py
Last active March 4, 2019 14:03
Transformacion de coordenadas MLP
import math as m
def mlp2sirgas(x_in, y_in):
K = 0.9993861340849
W = 0.0025759302920
T_x = 299836.7973
T_y = 6399665.955
teta= W * m.pi / 180.0
@marcelino-m
marcelino-m / sirgas2tte.py
Created December 2, 2016 21:13
Transformacion de coordenadas sirgas 2000 a coordenadas tte
import math as m
E = 374615.956
N = 6227561.662
R = m.pi * (13 +18.0/60.0 + 19.35/3600.0) / 180
d = 3000;
def sirgas2tte(e, n) :
tmpE = e - E;
We couldn’t find that file to show.