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 / 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 / docker-pry-rails.md
Created March 28, 2020 18:47 — forked from briankung/docker-pry-rails.md
Using pry-rails with 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
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
takeown /F "E:\Mis Documentos\Videos\*" /R /D S
icacls "E:\Mis Documentos\Joalbert\*" /grant Administradores:F /T
@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
@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 / 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 / attr_custom.rb
Last active August 10, 2020 17:36
ruby: Metaprogramming
# https://medium.com/@hackvan/entendiendo-la-metaprogramaci%C3%B3n-con-ruby-7a0360ee67e7
=begin
# Class implementa algunos interesantes métodos de introspección como:
class # Retorna el objeto de clase a la que pertenece el objeto instanciado
superclass # Retorna el objeto de clase del cual hereda la clase del objeto instanciado
ancestors # Retorna un Array con el listado de la cadena de ancestros
instance_variables # Retorna un Array con el listado de las variables de instancia creadas
# en la clase del objeto.
@joalbertg
joalbertg / nodelist-iteration.js
Created February 6, 2018 15:38
Iterar un nodeList
let elements = document.querySelectorAll('div'),
callback = (el) => { console.log(el); };
// Spread operator
[...elements].forEach(callback);
// Array.from()
Array.from(elements).forEach(callback);
// for...of statement