Skip to content

Instantly share code, notes, and snippets.

View rcotrina94's full-sized avatar

Richard Cotrina rcotrina94

View GitHub Profile
@rcotrina94
rcotrina94 / InsertarFinalVProlog.md
Created October 2, 2015 03:03
Visual Prolog: Insertar un elemento al final de una lista

#Visual Prolog

Insertar un elemento al final de una lista

@rcotrina94
rcotrina94 / InsertarInicioVProlog.md
Created October 2, 2015 03:08
Visual Prolog: Insertar un elemento al inicio de una lista

Visual Prolog

Insertar un elemento al inicio de una lista

@rcotrina94
rcotrina94 / esPrimoVProlog.md
Last active October 7, 2015 00:09
Visual Prolog: Verificar si un número es primo o no.

Visual Prolog

Identificar si el número es primo o no.

@rcotrina94
rcotrina94 / nginx_trim_www.conf
Last active November 11, 2015 19:05
[Nginx] Redirect www to no-www for multiple server names.
server {
listen 80;
server_name ~^(?!www\.)(?<domain>.+)$;
return 301 $scheme://$domain$request_uri;
}
BEGIN;
CREATE TABLE `sistema_categoriatipovino` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`nombre` varchar(64) NOT NULL
)
;
CREATE TABLE `sistema_tipovino` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`categoria_id` integer,
`anada` integer UNSIGNED NOT NULL,
{% extends "base/main.html" %}{% load staticfiles bootstrap %}
{% block header %}
{% endblock %}
{% block content %}
<div id="login-form" class="vcenter">
<div class="container-fluid">
<form method="POST" enctype="multipart/form-data" autocomplete="off">
{% csrf_token %}
<div class="col-xs-10 col-xs-offset-1 col-sm-6 col-sm-offset-3 col-lg-4 col-lg-offset-4">
<div class="panel panel-default">
@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 / 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
@rcotrina94
rcotrina94 / exporting-with-django-export-import.md
Last active March 24, 2016 17:30
Exportar en Django con "django-export-import"

Exportar en Django con "django-export-import"

django-export-import es un paquete de django que nos facilita la tarea de exportar e importar desde y hacia diferentes formatos de datos (CSV, XLS, JSON, HTML).

Éste paquete tiene 4 clases que serán las que más se utilizarían para exportar (y quizás también importar) fácilmente desde nuestra aplicación de Django.

class import_export.resource.ModelResource

Ésta clase nos sirve para poder utilizar los modelos de Django como recursos (Resources)

class import_export.resource.ResourceOptions (Meta)

|||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||
||||||||||||||||| ||||||||||||||||||||||
|||||||||||||||| ||||||||||||||||||||
|||||||| ||||| . ||||||||||||||
|||||| |||| |||||||||||||||
|||||| |||||||||||||||||