Skip to content

Instantly share code, notes, and snippets.

Avatar
👶
Motivated

Miguel Angel Asencio Hurtado maasencioh

👶
Motivated
View GitHub Profile
@maasencioh
maasencioh / .vimrc
Last active Sep 7, 2020
Configuration files
View .vimrc
" 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
General use commands
View commands.sh
# Who is using Port
lsof -nP -iTCP:$PORT | grep LISTEN
@maasencioh
maasencioh / labelnator.sh
Last active Jul 5, 2018 — forked from ZeroDragon/labelnator.sh
Para meter las labels a los repos de RTD
View labelnator.sh
#!/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 Aug 31, 2017
My vim configuration
View vimrc
" 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
View Tetrahedron.pde
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 Oct 20, 2016
netcdf.h functions unresolved
View output
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 Oct 17, 2016
CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib emconfigure ./configure CFLAGS="-L ${H5DIR}/lib -s USE_ZLIB=1"
View config.log
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 Aug 18, 2016 — forked from rbabich/ levmarq - Levenberg-Marquardt in plain C
A simple implementation of the Levenberg-Marquardt algorithm in plain C
View levmarq.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
View espruino_ESP8266.md

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
View tarea.js
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;