Non-blocking IO using co-routines in Python.
sudo port install libevent
virtualenv --no-site-packages env
<html> | |
<head><title>504 Gateway Time-out</title></head> | |
<body bgcolor="white"> | |
<center><h1>504 Gateway Time-out</h1></center> | |
<hr><center>nginx/1.4.4</center> | |
</body> | |
</html> |
<?php | |
$seconds = 60 * 2; // nginx default is 60 seconds | |
set_time_limit (60*60*24); // PHP keeps waiting for a whole day! | |
if (array_key_exists('s', $_REQUEST)) { | |
$seconds = intval($_REQUEST['s']); | |
} | |
<HTML><HEAD> | |
<TITLE>Network Error</TITLE> | |
</HEAD> | |
<BODY> | |
<FONT face="Helvetica"> | |
<big><strong></strong></big><BR> | |
</FONT> | |
<blockquote> | |
<TABLE border=0 cellPadding=1 width="80%"> | |
<TR><TD> |
import urllib2 | |
import re | |
from collections import Counter | |
url = 'http://profe-alexz.blogspot.com/2013/09/resultados-examen-admision-san-marcos-2014-i.html' | |
NAME_COUNT_LIMIT = 1000000 | |
def grab_page(url): | |
website = urllib2.urlopen(url) | |
return website.read() |
""" | |
WSGI config for renovaciones project. | |
This module contains the WSGI application used by Django's development server | |
and any production WSGI deployments. It should expose a module-level variable | |
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover | |
this application via the ``WSGI_APPLICATION`` setting. | |
Usually you will have the standard Django WSGI application here, but it also | |
might make sense to replace the whole Django WSGI application with a custom one |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Average(x, y float64) float64 { | |
return (x + y) / 2.0 | |
} |
#!/usr/bin/env python | |
# | |
# This is a demo script on how to use the Junar API provided by http://lima.datosabiertos.pe/ | |
# More info un Junar APIs here: http://wiki.junar.com/index.php/API | |
# | |
# Steps to install the Junar API client in a virtual environment: | |
# | |
# virtualenv --no-site-packages env | |
# source env/bin/activate | |
# pip install git+git://github.com/Junar/junar-api-python-client.git |
### Filesystem jumping | |
### Usage: Just add a line to your ~/.bashrc or ~/.bash_profile with "source /path/to/fsjumps.sh". | |
export MARKPATH=$HOME/.marks | |
function jump { | |
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" | |
} |
<?php | |
define('APP_PREFIX', '/path/to/subfolder/if/any/'); | |
define('REDIRECT_TARGET', 'http://localhost:8000/'); | |
if (array_key_exists('redirect_target', $_REQUEST)) { | |
$redirect_base = $_REQUEST['redirect_target']; | |
} else { | |
$redirect_base = REDIRECT_TARGET; | |
} |