Skip to content

Instantly share code, notes, and snippets.

View maasencioh's full-sized avatar

Miguel Angel Asencio Hurtado maasencioh

View GitHub Profile
@maasencioh
maasencioh / .vimrc
Last active September 7, 2020 12:09
Configuration files
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@maasencioh
maasencioh / commands.sh
Created May 8, 2020 14:41
General use commands
# Who is using Port
lsof -nP -iTCP:$PORT | grep LISTEN
@maasencioh
maasencioh / labelnator.sh
Last active July 5, 2018 18:53 — forked from ZeroDragon/labelnator.sh
Para meter las labels a los repos de RTD
#!/bin/sh
REPO=resuelve/$1
TOKEN=$2
labels=(
'{"name": "Bug 🐛", "description": "MUCHO ROJO!!!", "color": "d73a4a"}'
'{"name": "Documentación 📗", "description": "Documentación", "color": "a369ef"}'
'{"name": "Epic", "description": "Épica", "color": "3E4B9E"}'
'{"name": "Hackday 💡", "description": "Puntos extras por mejora muy opcional", "color": "5319e7"}'
@maasencioh
maasencioh / vimrc
Created August 31, 2017 06:33
My vim configuration
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@maasencioh
maasencioh / Tetrahedron.pde
Last active March 12, 2017 20:04
Tetrahedron
class Tetrahedron extends PlatonicSolid {
float ang = radians(120);
Tetrahedron() {
super();
}
public ArrayList<PVector> generateVertices () {
ArrayList<PVector> verticesArray = new ArrayList<PVector>();
verticesArray.add(new PVector(0, 0, radius));
@maasencioh
maasencioh / output
Created October 20, 2016 08:20
netcdf.h functions unresolved
DEBUG:root:PYTHON not defined in /home/maasencioh/.emscripten, using "/usr/bin/python"
DEBUG:root:JAVA not defined in /home/maasencioh/.emscripten, using "java"
WARNING:root:invocation: /home/maasencioh/Downloads/emsdk_portable/emscripten/master/emcc real.c -I/usr/include/ -I/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/ -o netfile.js -v (in /home/maasencioh/testNetCDF)
INFO:root:(Emscripten: Running sanity checks)
INFO:root:(Emscripten: Running sanity checks)
DEBUG:root:compiling to bitcode
DEBUG:root:emcc step "parse arguments and setup" took 0.11 seconds
DEBUG:root:compiling source file: real.c
DEBUG:root:running: /home/maasencioh/Downloads/emsdk_portable/clang/fastcomp/build_master_64/bin/clang -target asmjs-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=36 -D__EMSCRIPTEN_tiny__=0 -Werror=implicit-function-declaration -nostdinc -Xclang -nobuiltininc -Xclang -nostdsysteminc -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/local/include -Xclang -isyste
@maasencioh
maasencioh / config.log
Created October 17, 2016 12:16
CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib emconfigure ./configure CFLAGS="-L ${H5DIR}/lib -s USE_ZLIB=1"
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by netCDF configure 4.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure CFLAGS=-L /usr/lib64/lib -s USE_ZLIB=1
## --------- ##
## Platform. ##
@maasencioh
maasencioh / levmarq.c
Created August 18, 2016 15:51 — forked from rbabich/ levmarq - Levenberg-Marquardt in plain C
A simple implementation of the Levenberg-Marquardt algorithm in plain C
/*
* levmarq.c
*
* This file contains an implementation of the Levenberg-Marquardt algorithm
* for solving least-squares problems, together with some supporting routines
* for Cholesky decomposition and inversion. No attempt has been made at
* optimization. In particular, memory use in the matrix routines could be
* cut in half with a little effort (and some loss of clarity).
*
* It is assumed that the compiler supports variable-length arrays as

Installing JS into a Huzzah ESP8266 and run a Telegram bot in there

Installing Espruino

The first thing that will be needed is the drivers, so you will need to run:

$ pip install pyserial
$ pip2 install esptool
var SLR = ML.Regression.SLR;
var inputs = [10, 20, 50, 75, 80];
var outputs = [30, 50, 80, 100, 130];
var regression = new SLR(inputs, outputs);
var y = regression.predict(85);
var min = 1000000;
var max = -100000;