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++ - Ordenar numeros en una lista enlazada simple
*
* Copyright 2014 Martin Cruz Otiniano
*
* Description: Ordena mediante el criterio de burbuja una lista
*
* Site: www.marcsdev.com
*/
#include <iostream>
#include <cstdlib>
using namespace std;
int Ackerman(int m, int n)
{
if(m==0)
return n+1;
else
/*
* C++ - Agenda con uso de struct
*
* Copyright 2014 Martin Cruz Otiniano
*
* Site: www.marcsdev.com
*/
#include <iostream>
#include <stdlib.h>
@oca159
oca159 / hanoi.cpp
Last active August 29, 2015 14:22 — forked from codepainkiller/hanoi.cpp
#include <iostream>
#include <cstdlib>
using namespace std;
int hanoi(int n)
{
if(n == 1)
return 1;
else
#include <iostream>
#include <cstdlib>
using namespace std;
int Catalan(int n)
{
if (n <= 0)
return 1;
else
@oca159
oca159 / BMH.cpp
Last active August 29, 2015 14:22 — forked from codepainkiller/BMH.cpp
/*
* C++ - Algoritmo de Boyer Moore Horspool
*
* Copyright 2014 Martin Cruz Otiniano
*
* Site: www.marcsdev.com
*/
#include<iostream>
#include <stdlib.h>