Skip to content

Instantly share code, notes, and snippets.

View ekzGuille's full-sized avatar
🏠
Working from home

Guillermo Sesé ekzGuille

🏠
Working from home
View GitHub Profile
const DEFAULT_IONIC_DB = '_ionicstorage';
const DEFAULT_IONIC_TABLE = '_ionickv';
let db;
function setupIndexedDb() {
return new Promise((resolve, reject) => {
if (!indexedDB) {
return reject(new Error('indexedDB not suported'));
}
if (db) {
return resolve(db);
@ekzGuille
ekzGuille / .eslintrc.json
Last active June 15, 2021 12:36
Airbnb eslint configuration in one file
{
"env": {
"browser": true,
"commonjs": true,
"es6": true, // "es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12,
/*
Ejecutar un array de promesas en modo cascada
Promise.all([]) no serviría en este caso ya que las lanza todas a la vez
*/
const arrayPromesas = [];
const resolverCascada = async () => {
await arrayPromesas.reduce(async (promise, foo) => {
await promise;
// Hacer lo que sea necseario hacer con 'foo'
@ekzGuille
ekzGuille / html-append-inline.js
Created March 13, 2020 08:56
Añadir HTML desde javascript en una única línea. PRO MODE ENABLED 😎
// PRO TIP: Crear HTML Element + asignar valores en una sola linea
// Varias ejecuciones (metodo antiguo)
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = './script.js';
document.body.appendChild(script);
// Una sola ejecucion (metodo PRO 😎)
document.body.appendChild(
@ekzGuille
ekzGuille / jsdocs.js
Last active September 19, 2021 20:58
JSDocs @typedef/@type examples
/**
* @typedef Ejemplo2
* @property {number} prop11
*/
/**
* @typedef Ejemplo
* @property {string} prop1
* @property {number} prop2
* @property {boolean} prop3
@ekzGuille
ekzGuille / design-tips.md
Last active November 26, 2019 13:09
Truquillos sobre diseño. Colores, composición, fuentes, etc.

Colores:

Rojo:

Sirve para indicar peligro. No sobrecargar una web con el color rojo, molesta y distrae al usuario.

Naranja:

Más amigable que el rojo. Se utiliza mucho para los CTA (Call To Action) -> Botones de interacción con el usuario, para llamar la atención.

@ekzGuille
ekzGuille / settings.json
Last active August 21, 2022 10:31
VSCode user settings
{
"sync.gist": "d0d359643c5ddfac9325790a88e5293d",
"sync.autoDownload": true,
"sync.autoUpload": false,
"sync.forceDownload": false,
"sync.quietSync": true,
"sync.removeExtensions": true,
"sync.syncExtensions": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
# Mi bash_profile
HOST_NAME=Guille
source ~/.nvm/nvm.sh
nvm use stable
shopt -s autocd
shopt -s histappend
export PATH=$PATH:$HOME/bin
{
"Ansi 3 Color": {
"Green Component": 0.73333334922790527,
"Blue Component": 0,
"Red Component": 0.73333334922790527
},
"Tags": [],
"Ansi 12 Color": {
"Green Component": 0.3333333432674408,
"Blue Component": 1,
# Quitar la aceleracion del raton del MAC: http://triq.net/mac/mouse-acceleration
# Para tener accesible el panel de preferencias se puede acceder desde: Macintosh HD > Biblioteca > PreferencePanes (o desde codigo > cd /Library/PreferencePanes/)
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew cask install iterm2
# update iterm2 settings: https://gist.github.com/ekzGuille/c1a07e1f8078a82eb6f16132556bce1c
brew install bash # latest version of bash
# set brew bash as default shell: https://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/#Configure_terminal_to_use_it
brew install git