Skip to content

Instantly share code, notes, and snippets.

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

Joseph Boscan joeypy

🏠
Working from home
  • Designio
  • Caracas - Venezuela
View GitHub Profile
@joeypy
joeypy / gradle.properties
Created April 10, 2020 21:56
Linea de código que hay que agregar para compilar aplicaciones en Ionic 5 sin problema y configurar el gradle.
android.overridePathCheck=true
@joeypy
joeypy / Regular expressions.txt
Last active November 24, 2022 03:32
Regular expressions
Coincidencias Basicas
. - Cualquier Caracter, excepto nueva linea
\d - Cualquier Digitos (0-9)
\D - No es un Digito (0-9)
\w - Caracter de Palabra (a-z, A-Z, 0-9, _)
\W - No es un Caracter de Palabra.
\s - Espacios de cualquier tipo. (espacio, tab, nueva linea)
\S - No es un Espacio, Tab o nueva linea.
(?i) - Empieza el modo case-insensitive.
(?-i) - Desactiva el modo case-insensitive.
@joeypy
joeypy / my_view.py
Created September 5, 2021 20:11
Get the IP address from the client
def my_view(request):
...
...
client_ip = request.META['REMOTE_ADDR']
#or client_ip = request.META['X_FORWARDED_FOR']
...
@joeypy
joeypy / .gitignore
Last active October 3, 2021 17:46
.gitignore - Django project
# Created by https://www.toptal.com/developers/gitignore/api/django
# Edit at https://www.toptal.com/developers/gitignore?templates=django
### Django ###
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
@joeypy
joeypy / settings.py
Created November 10, 2021 04:44
Django static files not working when debug false || debug true
# In this article you will learn how to fix problem of not loading static files
# and media in Django even the DEBUG is FALSE. This is the easiest and safest solution.
# Django static and media files not working when debug is false
# Problem:
DEBUG = False #True
ALLOWED_HOSTS = ['*'] #Host name
# Problem Fix:

Configuración Básica

Configurar Nombre y Correo que salen en los commits

  git config --global user.name "Joseph Boscan"
  git config --global user.email "joeypc.py@gmail.com"

Marco de colores para los comando

 git config --global color.ui true
Folder structure for SASS
scss
|---- index.scss
|---- base
| |---- _animations.scss
| |---- _base.scss
| |---- _typography.scss
| |---- _utilities.scss
|---- abstracts
1. You mast have a public key from your mashine stored on github as SSH key here:
https://github.com/settings/ssh
How to create ssh key on unix/mac os x:
- Open terminal, go to the root typing: $ cd ~ (recommended)
- Type: ssh-keygen -t rsa -C "your@email.address"
- To secure your ssh key ststem will ask you for passphrase (recommended) but you can skip it also
- That's you have the ssh key
- Check it with: $ ls -al ~/.ssh
- Type: $ cd .ssh
18 Python scripts that help you write code faster
Python is a no-BS programming language. Readability and simplicity of design are two of the biggest reasons for its immense popularity.
This is why it is worthwhile to remember some common Python tricks to help improve your code design. These will save you the trouble of surfing Stack Overflow every time you need to do something.
The following tricks will prove handy in your day-to-day coding exercises.
1. Finding Unique Elements in a String
The following snippet can be used to find all the unique elements in a string. We use the property that all elements in a set are unique.
my_string = "aavvccccddddeee"

Code JS

groupBy

var groupBy = function(xs, key) {
  return xs.reduce(function(rv, x) {
    (rv[x[key]] = rv[x[key]] || []).push(x);
    return rv;
  }, {});
};