Skip to content

Instantly share code, notes, and snippets.

@pawelmhm
pawelmhm / dabblet.css
Created July 1, 2013 14:58
almost a bicycle
/* almost a bicycle */
#bike {
width:400px;
height:250px;
position:relative;
margin:20px 0;
-webkit-transition: -webkit-transform 3s linear;
}
@pawelmhm
pawelmhm / asyncio_crawler.py
Created February 25, 2016 20:36
basic crawler
#!/usr/local/bin/python3.5
import asyncio
from aiohttp import ClientSession
class Crawler(object):
i = 1
limit = 5
url = "http://localhost:8080/{}"
@pawelmhm
pawelmhm / simple.py
Last active July 3, 2016 12:33
Twisted resource to test HTTP2
import json
import sys
from twisted.internet.ssl import DefaultOpenSSLContextFactory
from twisted.web import server
from twisted.web.resource import Resource
from twisted.internet import reactor
from twisted.python import log
@pawelmhm
pawelmhm / header_order_downloader.py
Last active July 19, 2023 20:02
Scrapy downloader that preserves header order
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
import logging
from collections import OrderedDict
from time import time
from urllib.parse import urldefrag
from scrapy.core.downloader import Downloader
from scrapy.core.downloader.handlers.http11 import HTTP11DownloadHandler, \
@pawelmhm
pawelmhm / gist:8917867
Last active January 23, 2024 15:03
Scrapy spider crawling Stack Overflow
from scrapy.spider import Spider
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy.item import Item, Field
import urllib
class Question(Item):
tags = Field()
answers = Field()