Skip to content

Instantly share code, notes, and snippets.

View rcotrina94's full-sized avatar

Richard Cotrina rcotrina94

View GitHub Profile
@rcotrina94
rcotrina94 / How to vertically center HTML objects.
Last active December 23, 2015 13:49
How to vertically center HTML objects whitin a container
#How to vertically center HTML objects.
Only with pure HTML and CSS
Requirements:
- The height of the element's container must be known or specified.
@rcotrina94
rcotrina94 / How to use Images as Radio buttons.md
Last active October 18, 2024 16:03
How to use images for radio buttons (input-radio).
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
@rcotrina94
rcotrina94 / regex para staticfiles en Django
Last active May 9, 2023 08:17
Find and Replace Django static files from template
Find what:
`(href|src)="([a-zA-Z0-9/.-]+[^.html])"`
Replace with:
`$1=\"{% static "assets/$2" %}"`
@rcotrina94
rcotrina94 / NGINX para Tumblr
Last active August 29, 2015 14:14 — forked from anonymous/gist:887026
Configuración de nginx para Tumblr
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name _SERVER_NAME_;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@rcotrina94
rcotrina94 / Tabla de Kolmogorov-Smirnov en JS
Last active August 29, 2015 14:14
Tabla de Kolomogorov-Smirnov
Archivo de Constantes para: http://rcotrina.devux.pe/lab/uns/din-ii/2015-00/und1/FinalNumPseudo/
@rcotrina94
rcotrina94 / mistakes.md
Last active August 29, 2015 14:16
What are mistakes which software engineers make in the first 1-2 years of their career?

What are mistakes which software engineers make in the first 1-2 years of their career?

  1. Not being willing to learn new languages and skills. Not willing to read technical books.
  2. Not paying attention to performance: Use of good Data Structure and Algorithms
  3. Not paying attention to design: Design Pattern, Object Modeling, Best Practices
  4. Not paying attention to security: SQL Injection
  5. Not paying attention to testing: Writing test cases.
  6. Documentation: Improper logging and comments.
  7. Blind copy paste making an assumption that it would work.
  8. Forget to take backup and remove all debugging statements like System.out.print before application goes into production.
  9. Jumping directly on solution. Don't start solution hunting the moment you face a problem or bug. Even if you copy from others solution, don't forget to learn and understand the solution.
@rcotrina94
rcotrina94 / end_bashrc
Last active August 29, 2015 14:18
virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/webapps
source /usr/local/bin/virtualenvwrapper.sh
@rcotrina94
rcotrina94 / Setup.md
Last active February 13, 2016 19:50
Development Environment Setup

Actualizar índices de repositorios

sudo apt-get update

Instalar git

sudo apt-get install git

Instalar mercurial

sudo apt-get install mercurial