Skip to content

Instantly share code, notes, and snippets.

View juanriaza's full-sized avatar
🎯
Focusing

Juan Riaza juanriaza

🎯
Focusing
View GitHub Profile
@juanriaza
juanriaza / gist:3964643
Created October 27, 2012 13:40
mitele python
import json
import requests
#req = requests.get('http://www.mitele.es/ipadws/?action=getHome&device=ipa')
#req = requests.get('http://www.mitele.es/ipadws/?action=getContent&contentId=46231&device=ipa')
req = requests.get('http://servicios.mitele.es/tokenizer/tkjs.php?id=/nogeo/seriesonline/laqueseavecina/t2/c19.mp4', headers={'User-agent': 'iPad'})
print json.loads(req.content.replace('videoTokenizer(', '')[:-2])['tokenizedUrl']
# -*- coding: utf-8 -*-
import json
import requests
from lxml import etree
#req = requests.get('http://www.mitele.es/ipadws/?action=getHome&device=ipa')
#req = requests.get('http://www.mitele.es/ipadws/?action=getContent&contentId=46231&device=ipa')
#req = requests.get('http://servicios.mitele.es/tokenizer/tkjs.php?id=/nogeo/seriesonline/laqueseavecina/t2/c19.mp4', headers={'User-agent': 'iPad'})
juanriaza at MacBookPro in ~
(cpython273) $ whois facebook.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
FACEBOOK.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM
@juanriaza
juanriaza / gist:4370122
Created December 24, 2012 17:32
javascript overload debug websockets
WebSocket.prototype._send = WebSocket.prototype.send;
WebSocket.prototype.send = function (data) {
console.log("\u2192 " + data);
this._send(data);
this.addEventListener('message', function (msg) {
console.log('\u2190 ' + msg.data);
}, false);
this.send = function (data) {
this._send(data);
console.log("\u2192 " + data);
@juanriaza
juanriaza / currency.proto
Created January 3, 2013 18:10
simpsons tapped out hack
message Currency {
required uint64 a = 1;
required uint64 b = 2;
required uint64 c = 3;
required uint64 donuts = 4;
required uint64 e = 5;
}
@juanriaza
juanriaza / gist:4665340
Created January 29, 2013 16:01
renfe app api
{10: {'config': {'descripcion': 'Madrid',
'iconomapa': 'pin_cercanias',
'incidencias': 'http://infocer.renfe.es/informacionCercanias/incidenciasXML.do?login=aplinf1&password=HTULE593&idnucleo=10',
'lat': '40.40615564778484',
'lon': '-3.688957970842623',
'tarifas': 'http://www.renfe.com/viajeros/cercanias/madrid/abonos_y_descuentos/index.html'},
'content': {'dateTimeUpdate': '20130101113000',
'estaciones': 'http://api.mo2o.com/apps/RenfeApp/contents/estaciones_10.xml.gz',
'lineas': 'http://api.mo2o.com/apps/RenfeApp/contents/lineas_10.xml.gz',
'mapaesquematico': 'http://api.mo2o.com/apps/RenfeApp/contents/mapaesquematico_10.xml.gz',
import base64
import hashlib
from django.contrib.auth.hashers import BasePasswordHasher, mask_hash
from django.utils.crypto import constant_time_compare
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
class SymfonyPasswordHasher(BasePasswordHasher):
import tablib
lines = csv_data.split('\n')[:-1]
clean = lambda data: map(lambda e: e.strip('"'), data.split(','))
headers = clean(lines[0])
data = [clean(contact) for contact in lines[1:]]
parsed_data = tablib.Dataset(*data, headers=headers)
print parsed_data.json
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT(phantompy)
SET(CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
#SET(CMAKE_BUILD_TYPE "Release")
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_AUTOMOC ON)
# -*- coding: utf-8 -*-
import os
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
url = 'http://goo.gl/mff2'
print url
req = requests.get(url)