Skip to content

Instantly share code, notes, and snippets.

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

Osvaldo Cordova Aburto oca159

🏠
Working from home
View GitHub Profile
@oca159
oca159 / snake.py
Created February 19, 2018 19:55 — forked from paul-schwendenman/snake.py
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@oca159
oca159 / gunicorn
Created February 19, 2018 19:42 — forked from paul-schwendenman/gunicorn
Gunicorn setup
#!/bin/bash
# /etc/init.d/gunicorn
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
@oca159
oca159 / nginx-site.sh
Created February 18, 2018 05:52 — forked from ljfauscett/nginx-site.sh
nginx enable/disable sites
#!/bin/bash
SITES_AVAILABLE_DIR=/etc/nginx/sites-available
SITES_ENABLED_DIR=/etc/nginx/sites-enabled
function print_usage() {
echo "nginx-site -e <site name> to enable"
echo "nginx-site -d <site name> to disable"
}
@oca159
oca159 / nginxproxy.md
Created January 8, 2018 15:03 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

/*
* C++ - Arbol binario de busqueda aplicado en archivos
* Copyright 2013 Martin Cruz Otiniano
* Description : Tiene las funciones de insertar registro en un nodo (escribir), mostrar los registros
* haciendo uso del algoritmo y eliminar archivo ABB.
* Site : www.marcsdev.com
*/
#include <iostream>
#include <stdio.h>
/*
* C++ - Metodo de dispersion (Hashing)
* Copyright 2013 Martin Cruz Otiniano
* Site: www.marcsdev.com
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* Criba de Eratostenes - C++
* Copyright 2014 Martin Cruz Otiniano
* Description : Esta funcion devuelve un vector(STL) con los numeros primos hasta un rango n enviado como parametro.
* Site : www.marcsdev.com
*/
#include <iostream>
#include <vector>
#include <cmath>
/*
* C++ - Árboles Binarios de Búsqueda
* Copyright 2014 Martin Cruz Otiniano
* Description : Funciones de Insercion, Busqueda, Eliminacion, Recorridos por niveles(amplitud), Altura, Arbol reflejo, Contar hojas.
* Site : www.marcsdev.com
*/
#include <iostream>
#include <stdlib.h>
/*
* C++ - Autómata Finito Determinista
* Copyright 2014 Martin Cruz Otiniano
* Description: Ingresa automata, verifica palabra
* Site: www.marcsdev.com
*/
#include <iostream>
#include <vector>
#include <algorithm>
@oca159
oca159 / pilas.cpp
Last active August 29, 2015 14:22 — forked from codepainkiller/pilas.cpp
/*
* C++ - Pilas/Stack
* Copyright 2014 Martin Cruz Otiniano
* Description : Apila elemento, Desempila elemento, Mostrar pila, Destruir Pila
* Site : www.marcsdev.com
*/
#include <iostream>
using namespace std;