Skip to content

Instantly share code, notes, and snippets.

View joalbertg's full-sized avatar
🎯
Focusing

Joalbert Andrés González joalbertg

🎯
Focusing
View GitHub Profile
@joalbertg
joalbertg / DCL.rb
Last active August 10, 2020 17:37
ruby: Metaprogramming
class HTML
def self.respond_to_missing?(method_name, *args)
# TODO: completar
end
def self.method_missing(method_name, *args, &block)
method_name ? tag(method_name, *args, &block) : super
end
def self.tag(tag_name, *args, &_block)
@joalbertg
joalbertg / logic_exercise_one.js
Created October 19, 2019 23:06
Logic Exercises
//*=============================================================================================
// Cuatro letras
//
// De cuatro corredores de atletismo se sabe que C ha llegado inmediatamente detrás de B,
// y D ha llegado en medio de A y C. ¿Podría calcular el orden de llegada?
//*=============================================================================================
// B
// C
// D
@joalbertg
joalbertg / README.md
Last active October 23, 2019 19:33
List of Rails Status Code Symbols
Status Code Status Message Symbol
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
201 Created :created
202 Accepted :accepted
takeown /F "E:\Mis Documentos\Videos\*" /R /D S
icacls "E:\Mis Documentos\Joalbert\*" /grant Administradores:F /T
Config file /lib/systemd/system/docker.service
# CentOS
---------
# Utilidades
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Agregar el repo de docker
@joalbertg
joalbertg / .vimrc
Last active June 3, 2020 23:53
config vim/neovim
" add numbers
set number
" add mouse
set mouse=a
" add with numbers
set numberwidth=1
" select copy to clipboar
set clipboard=unnamed
" show colors
syntax enable
@joalbertg
joalbertg / docker-pry-rails.md
Created March 28, 2020 18:47 — forked from briankung/docker-pry-rails.md
Using pry-rails with Docker
@joalbertg
joalbertg / README.md
Created March 30, 2020 01:46
Docker: Here is the complete syntax for the .dockerignore
pattern:
{ term }
term:
'*' matches any sequence of non-Separator characters
'?' matches any single non-Separator character
'[' [ '^' ] { character-range } ']'
character class (must be non-empty)
c matches character c (c != '*', '?', '\\', '[')
'\\' c matches character c
@joalbertg
joalbertg / Dockerfile
Created April 29, 2020 19:42
docker: alphine-python3
# By: https://github.com/Docker-Hub-frolvlad
FROM alpine:3.11
# This hack is widely applied to avoid python printing issues in docker containers.
# See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13
ENV PYTHONUNBUFFERED=1
RUN echo "**** install Python ****" && \
apk add --no-cache python3 && \
@joalbertg
joalbertg / proc_case.rb
Created May 22, 2020 16:46
ruby: Proc with case
# https://womanonrails.com/functional-programming-ruby
proc1 = Proc.new { |number| number % 3 == 0 }
proc2 = Proc.new { |number| number % 3 == 1 }
case 3
when proc1 then p 'proc1'
when proc2 then p 'proc2'
else
p 'not a proc'
end