Skip to content

Instantly share code, notes, and snippets.

View mabelvj's full-sized avatar

Mabel Villalba mabelvj

View GitHub Profile
@mabelvj
mabelvj / certificate_python_conections_firewall.txt
Last active April 11, 2019 10:57 — forked from simonw/gist:68d19a46e8edc2cd8c68
Fix "Do you want the application "python" to accept incoming network connections?" by code signing the python executable in your virtualenv - copied here in case https://www.darklaunch.com/2014/02/02/fix-do-you-want-the-application-python-to-accept-incoming-network-connections ever goes away.
With the OS X firewall enabled, you can remove the "Do you want the application "python" to accept incoming network connections?" message.
Create a self-signed certificate.
Open Keychain Access. Applications > Utilities > Keychain Access.
Keychain Access menu > Certificate Assistant > Create a Certificate...
Enter a Name like "My Certificate".
Select Identity Type: Self Signed Root
Select Certificate Type: Code Signing
Check the Let me override defaults box
@mabelvj
mabelvj / file.csv
Created January 16, 2019 01:32
Data extracted from EMT
title datePublished
McDonald’s ofrecerá un menú premium que habrá sido cocinado en otro sitio 2019-01-14T19:45:11+00:00
Las mejores bandas de mariachis para echar a tu inquilino 2019-01-14T19:45:11+00:00
“Tienes que ver este meme hasta el final”, te dice un amigo enseñándote la película “El Padrino” en el móvil 2019-01-10T12:31:52+00:00
Un imbécil le da a “Pulse peatón” sin darse cuenta de que el otro peatón ya había pulsado 2019-01-10T12:31:52+00:00
Carlos de Inglaterra lleva tres décadas reinando disfrazado de anciana 2019-01-10T13:05:33+00:00
Una señora cada vez ve menos probable que la enorme pintada de un pene que hay en la fachada de su casa desde 2012 y que está firmada por Banksy sea realmente de Banksy 2019-01-10T13:05:33+00:00
PP y Ciudadanos insisten en que su acuerdo de Gobierno p ara Andalucía hace muy, muy poquitas concesiones a Hitler 2019-01-10T18:46:38+00:00
Marie Kondo recomienda conservar únicamente tres familiares 2019-01-10T18:46:38+00:00
Consejos para ahorrar en la cuesta de enero 20
@mabelvj
mabelvj / emt.py
Created January 16, 2019 01:23
El Mundo Today Spider
# -*- coding: utf-8 -*-
import scrapy
from scrapy.exceptions import CloseSpider
from datetime import datetime
from urllib.parse import urljoin
class EmtSpider(scrapy.Spider):
name = 'emt'
allowed_domains = ['www.elmundotoday.com']
@mabelvj
mabelvj / script.py
Created January 15, 2019 12:31
Lua Script for Scrapy Splash
script = """
function main(splash)
local num_scrolls = 10
assert(splash:go(splash.args.url))
local get_dimensions = splash:jsfunc([[
function () {
var rect = document.getElementsByClassName('css-vsuiox')[0]
.getElementsByTagName('button')[0]
.getClientRects()[0];
return {"x": rect.left, "y": rect.top};
@mabelvj
mabelvj / news.py
Last active January 14, 2019 16:48
nytimes spider
# -*- coding: utf-8 -*-
import scrapy
from scrapy_splash import SplashRequest
script = """
function main(splash)
local num_scrolls = 10
assert(splash:go(splash.args.url))
local get_dimensions = splash:jsfunc([[
@mabelvj
mabelvj / parse_method.py
Last active January 14, 2019 16:43
news_parse_method
def parse(self, response):
entries = response.xpath('//li[@data-testid="search-bodega-result"]')
titles = entries.xpath('//h4//text()').extract()
types = entries.xpath('//p[@class="css-myxawk"]//text()').extract()
dates = entries.xpath('//time//text()').extract()
for element in zip(titles, types, dates):
yield {'title': element[0], 'type': element[1], 'date': element[2]}
@mabelvj
mabelvj / gist:252d9b4a303492bd2cd06d84b406cb2b
Created December 1, 2017 00:45 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@mabelvj
mabelvj / countries.csv
Last active June 19, 2017 11:12
Health expenditure vs life expectancy at birth
name alpha-2 alpha-3 country-code iso_3166-2 region sub-region region-code sub-region-code
Afghanistan AF AFG 004 ISO 3166-2:AF Asia Southern Asia 142 034
Åland Islands AX ALA 248 ISO 3166-2:AX Europe Northern Europe 150 154
Albania AL ALB 008 ISO 3166-2:AL Europe Southern Europe 150 039
Algeria DZ DZA 012 ISO 3166-2:DZ Africa Northern Africa 002 015
American Samoa AS ASM 016 ISO 3166-2:AS Oceania Polynesia 009 061
Andorra AD AND 020 ISO 3166-2:AD Europe Southern Europe 150 039
Angola AO AGO 024 ISO 3166-2:AO Africa Middle Africa 002 017
Anguilla AI AIA 660 ISO 3166-2:AI Americas Caribbean 019 029
Antarctica AQ ATA 010 ISO 3166-2:AQ