Skip to content

Instantly share code, notes, and snippets.

View leonardoAlonso's full-sized avatar
:octocat:
<coding/>

Leonardo David Alonso Sosa leonardoAlonso

:octocat:
<coding/>
View GitHub Profile
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
@leonardoAlonso
leonardoAlonso / README.md
Created March 10, 2022 21:17 — forked from dnaprawa/README.md
Using Docker on remote Docker Host with docker context

Working on remote Docker Host using docker context

SSH keys on Windows

In order to use remote Docker host, as a prerequisite you need SSH enabled (required login using SSH keys).

Generate or find your public SSH key

Go to C:\Users\YOUR_USERNAME\.ssh and copy content of id_rsa.pub file

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@leonardoAlonso
leonardoAlonso / .vimrc
Last active January 5, 2021 19:41
My neovim configuration
set number
set mouse=a
set numberwidth=1
set clipboard=unnamed
syntax enable
set showcmd
set ruler
set encoding=utf-8
set showmatch
set sw=4
suma_v = block.suma_bloque(bloques)
img_marcada = np.zeros((self.b.shape), np.uint8)
bloques_marcados = block.separa_bloque(img_marcada)
lista_binaria = block.lista_marca(self.marca)
lista_bloques_marcador = []
q = 16.0
for i in range(0, len(bloques_marcados)):
bloque_m = bloques_marcados[i]
bloque_o = bloques[i]
@leonardoAlonso
leonardoAlonso / Postgress.sql
Created December 23, 2020 17:32
Postgres commands
/*Login postgres
sudo -u postgres psql postgres
psql -d odoo // in user with access granted
*/
/*Tamaño de una base de datos */
SELECT pg_database_size('ventas');
/*Tamano de una tabla*/
@leonardoAlonso
leonardoAlonso / gist:06f0ab8c06773f0bcb3206fbd6c69e25
Created December 3, 2020 00:32 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
Eliminar usando regex
ls | grep -P "regex" | xargs -d"\n" rm
Descomprimir tat.bz2
tar -xjvf example.tar.bz2
restore postgresql database with dump file
def lamps(lamps_list):
steps = 0
for idx in range(0, len(lamps_list) - 1):
if lamps_list[idx + 1] == lamps_list[idx]:
steps += 1
lamps_list[idx + 1] = 1 if lamps_list[idx] == 0 else 0
return steps
if __name__ == "__main__":
assert lamps([1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1]) == 5
assert lamps([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 6
@leonardoAlonso
leonardoAlonso / shapening.py
Last active December 4, 2019 19:43
Image filters using python-opencv
import cv2
import numpy as np
def sharpening(image):
kernel_sharp = np.array([
[-1,-1,-1,-1,-1],
[1,2,2,2,-1],
[-1,2,8,2,-1],
[1,2,2,2,-1],
[-1,-1,-1,-1,-1]]