Skip to content

Instantly share code, notes, and snippets.

View emrivero's full-sized avatar
💻
Road to computer engineering

Emilio Martínez Rivero emrivero

💻
Road to computer engineering
  • G+D
  • Seville, Spain
View GitHub Profile
@emrivero
emrivero / event_manager.js
Created November 28, 2019 21:46
Small key event manager
class EventManager {
constructor(keyBindings, options) {
this.pressedKeys = {};
this.keyBindings = keyBindings;
this.options = options;
if (document) {
document.addEventListener('keydown', e => this.pressedKeys[e.key] = true);
document.addEventListener('keyup', e => this.pressedKeys[e.key] = false);
}
@emrivero
emrivero / LayerGroup.md
Last active September 11, 2019 08:37
Documentación de la API de M.layer.LayerGroup

API LayerGroup

Constructor:

new M.layer.LayerGroup({
  id: <string>,
  title: <string>,
  collapsed: <boolean>,
  zIndex: <number>,
 children: &gt;,
@emrivero
emrivero / script.sh
Created June 26, 2019 21:17
Windows USB Bootable from Command Linux
sudo dd bs=4M if=/path/to/iso of=/dev/sd[letter]
@emrivero
emrivero / bar.js
Created March 28, 2019 18:29
Console progress Bar in Node.js
/**
* Bar object
* @class
*/
class Bar {
constructor(msg, time) {
this.arrBar = new Array(10).fill('.');
this.msg = msg;
this.time = time;
this.currentTime = 0;
@emrivero
emrivero / cloudSettings
Last active July 2, 2021 09:00
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-02T09:00:42.185Z","extensionVersion":"v3.4.3"}
@emrivero
emrivero / api_rest_styles.yml
Last active November 30, 2018 12:00
REST examples of Vector layers with styles (Mapea 5)
Point:
WFS:
Cluster: "http://sigc.desarrollo.guadaltel.es/mapea5/?wmcfile=cdau,cdau_satelite,cdau_hibrido&controls=navtoolbar,layerswitcher&layers=WFS*CapaWFS*http://clientes.guadaltel.es/desarrollo/geossigc/ggis/ows?*ggis:Colegios*MPOINT***eyJwYXJhbWV0ZXJzIjpbeyJyYW5nZXMiOltdLCJob3ZlckludGVyYWN0aW9uIjp0cnVlLCJkaXNwbGF5QW1vdW50Ijp0cnVlLCJzZWxlY3RJbnRlcmFjdGlvbiI6dHJ1ZSwiZGlzdGFuY2UiOjYwLCJhbmltYXRlZCI6dHJ1ZSwibWF4RmVhdHVyZXNUb1NlbGVjdCI6MTUsImxhYmVsIjp7InRleHQiOiJ7e2Z9fWZ1bmN0aW9uICh0KXt2YXIgZSxpPXQuZ2V0QXR0cmlidXRlKFwiZmVhdHVyZXNcIik7cmV0dXJuIGkubGVuZ3RoJiYoZT1pLmxlbmd0aC50b1N0cmluZygpKSxlfSIsImNvbG9yIjoiI2ZmZiIsImZvbnQiOiJib2xkIDE1cHggQXJpYWwiLCJiYXNlbGluZSI6Im1pZGRsZSIsImFsaWduIjoiY2VudGVyIn19LHsiYW5pbWF0aW9uRHVyYXRpb24iOjI1MCwiYW5pbWF0aW9uTWV0aG9kIjoibGluZWFyIiwiZGlzdGFuY2VTZWxlY3RGZWF0dXJlcyI6MTUsImNvbnZleEh1bGxTdHlsZSI6eyJmaWxsIjp7ImNvbG9yIjoiI2ZmZiIsIm9wYWNpdHkiOjAuMjV9LCJzdHJva2UiOnsiY29sb3IiOiIjN2I5OGJjIn19fSxbXV0sImRlc2VyaWFsaXplZE1ldGhvZCI6Ik0uc3R5bGUuQ2x1c3Rlci5kZXNlcmlhbGl6ZSJ9"
Heatmap
@emrivero
emrivero / init.coffee
Last active December 13, 2018 12:01
atom-settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@emrivero
emrivero / init.coffee
Last active April 12, 2018 19:35 — forked from manmorjim/init.coffee
atom-settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@emrivero
emrivero / .zshrc
Created April 12, 2018 18:22 — forked from manmorjim/.zshrc
ZSH configuration file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/manueljmorillo/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="agnoster"
@emrivero
emrivero / mapeapublish.sh
Created April 12, 2018 10:35
Publish a new Mapea WAR
#!/usr/bin/env bash
USER=`whoami`
MAPEA_WAR=/var/lib/tomcat8/webapps/mapea.war
MAPEA_DIR=/var/lib/tomcat8/webapps/mapea
NEW_MAPEA_WAR=/home/$USER/mapeachap/mapea-chap/src/mapea-rest/target/mapea.war
TOMCAT_WEBAPPS=/var/lib/tomcat8/webapps/
deleteFile() {
if [ -f $1 ]; then