Skip to content

Instantly share code, notes, and snippets.

View juanriaza's full-sized avatar
🎯
Focusing

Juan Riaza juanriaza

🎯
Focusing
View GitHub Profile
{
"És important que quan arribis al lloc, notifiquis la teva arribada": "",
"Vols tornar a començar el registre de nou?": "¿Quieres volver a empezar el registro?",
"Vols reiniciar la configuració i començar de nou?": "",
"Vols esborrar la configuració de l'app i començar de nou?": "",
"Vols confirmar la teva assistència a l'acció?": "¿Quieres confirmar tu asistencia a la acción?",
"Usuari": "Usuario",
"Un espai on pots compartir el teu compromís en forma de temps i recursos. El Tsunami és fet de gotes.": "",
"Tria una contrasenya": "Escoge una contraseña",
"Torna a iniciar el procés de registre": "Vuelve a iniciar el proceso de registro",
@juanriaza
juanriaza / bicimad.py
Created June 11, 2019 10:10
bicimad stations
import json
import gzip
import requests
import binascii
response = requests.post(
'https://api.bicimad.com/emt_v10/',
json={
"app_hash":"c26a08fe1d186dad371881fd6a3fab29438a8c48_com.emtmadrid.bicimad.gestion2",
@juanriaza
juanriaza / mcdonalds.js
Last active November 15, 2017 11:00
mcdonalds.js
Java.perform(function () {
var klass = Java.use('com.mcdonalds.android.ui.offers.myMcDonalds.MyMcDonaldsOffersPresenterImpl');
var loyaltyType = Java.use('com.mcdonalds.android.data.UserProfileData$LoyaltyType');
klass.getUserLevel.implementation = function () {
return loyaltyType.GOLD.value;
};
});
{
"terminal.external.osxExec": "iTerm.app",
"editor.fontSize": 12,
"files.exclude": {
"**/*.pyc": true
// "node_modules": true
},
"editor.fontFamily": "OperatorMonoSSm-Light",
"editor.renderWhitespace": "all",
"editor.fontLigatures": true,
@juanriaza
juanriaza / diputados_spider.py
Created October 20, 2016 08:42
diputados scrapy
import scrapy
class DiputadosSpider(scrapy.Spider):
name = 'diputados'
start_urls = ['http://www.congreso.es/portal/page/portal/Congreso/Congreso/Diputados']
def parse(self, response):
lista_diputados_url = response.xpath(
'//div[@id="btn_mas"]/a/@href').extract_first()
@juanriaza
juanriaza / diputados.py
Created October 20, 2016 08:30
diputados ejemplo basico
import requests
from urllib.parse import urljoin
from lxml.html import fromstring
def parse_diputado(response):
tree = fromstring(response.content)
nombre = tree.xpath('//div[@class="nombre_dip"]/text()')[0]
print(nombre)
@juanriaza
juanriaza / System Design.md
Created April 18, 2016 17:11 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
import geopy
from geopy.distance import vincenty
def bounding_box_coordinates(location, radius):
'''
Given a latitude and longitude in degrees as a tuple and a radius in km
calculates the bounding box coordinates using the vincenty formula.
'''
origin = geopy.Point(*location)
import json
import scrapy
import urllib
class ExampleSpider(scrapy.Spider):
name = 'habrahabr.ru'
start_urls = ['http://habrahabr.ru/']
def parse(self, response):
@juanriaza
juanriaza / tweets.py
Created September 30, 2015 21:08
Diccionario tweets
from django.utils import timezone
tweets = [
{'user_name': 'jorgebastida', 'message': 'Hello world!', 'timestamp': timezone.now()},
{'user_name': 'jaimeirurzun', 'message': 'I like ponies! http://djangopony.com', 'timestamp': timezone.now()},
{'user_name': 'jorgebastida', 'message': 'Django RULEZZZZZZ', 'timestamp': timezone.now()}
]