Skip to content

Instantly share code, notes, and snippets.

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

Braulio Soncco soncco

🏠
Working from home
View GitHub Profile
import urllib, urllib2, pytesseract, os
from PIL import Image
f = open('/tmp/captcha.jpg', 'wb')
f.write(urllib.urlopen('http://www.sunat.gob.pe/cl-ti-itmrconsruc/captcha?accion=image').read())
f.close()
codigo = pytesseract.image_to_string(Image.open('/tmp/captcha.jpg'))
print codigo
os.remove('/tmp/captcha.jpg')
data = [('codigo', codigo), ('accion', 'consPorRuc'), ('nroRuc', '20549949232'),]
@soncco
soncco / scroll.js
Created August 1, 2014 03:31
Simple bootstrap menu animation
$(window).scroll(function() {
if ($(".conciencia").offset().top>50)
$(".conciencia").addClass("complete");
else
$(".conciencia").removeClass("complete");
});
@soncco
soncco / bootstrap.css
Created June 25, 2014 18:08
Python xhtml2pdf Bootstrap3 CSS
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
@soncco
soncco / ubuntu14.04
Created June 13, 2014 00:05
Ubuntu 14.04
#!/bin/sh
###############################################################################
############# CONFIGURADOR SERVER ESTANDAR LAMP UBUNTU 14.04 ##################
################################################################## v 0.1 ######
##### ejecutar como root (sin sudo) ###########################################
##### requisitos: #############################################################
##### *) ssh y ssh_keys instaladas ############################################
##### *) particiones extras montadas (/home/mysql, swap) ######################
##### *) resolv.conf contiene los dns validos (google o isp) ##################
@soncco
soncco / rgb.html
Created October 24, 2013 03:14
Pequeño ejemplo de colores con RGB.
<!doctype html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
float: left;
}
</style>
@soncco
soncco / 1. django+gunicorn+nginx
Last active September 16, 2017 22:08
Manera fácil de hacer Deploy con Django en un VPS.
# Create sudo user
adduser <user>
usermod -a -G sudo <user>
logout
# Update and clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
@soncco
soncco / package.json
Created September 11, 2013 17:33
El package.json más básico del mundo.
{
"name": "curso-backend",
"version": "0.0.1",
"dependencies": {
"express": "~3.4.0"
}
}
// module dependencies
var http = require('http'),
url = require('url');
/**
* UrlReq - Wraps the http.request function making it nice for unit testing APIs.
*
* @param {string} reqUrl The required url in any form
* @param {object} options An options object (this is optional)
@soncco
soncco / index.jade
Last active December 17, 2015 17:19
Initializr HTML5 Responsive with Jade and Stylus
doctype
//if lt IE 7
html.no-js.lt-ie9.lt-ie8.lt-ie7
//if IE 7
html.no-js.lt-ie9.lt-ie8
//if IE 8
html.no-js.lt-ie9
//[if gt IE 8]><!
html.no-js
//<![endif]

Step 1: Clone the bundles into your Sublime Text packages directory

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Step 2: Restart Sublime Text 2