Skip to content

Instantly share code, notes, and snippets.

View alexcepoi's full-sized avatar

Alex Cepoi alexcepoi

View GitHub Profile
@alexcepoi
alexcepoi / gist:2e62e6622f4204eab99027eda813e911
Last active July 16, 2016 11:46
i3pystatus localtime not working
# Test config 1:
status.register('clock', format=('%-d %b %H:%M %Z', 'Europe/Bucharest')) // works
status.register('clock', format=('%a %-d %b %H:%M')), // localtime, should be London but still shows EEST (Bucharest time)
{"markup": "none", "color": "#2e9ef4", "full_text": "Sat 16 Jul 14:37", "urgent": false, "name": "i3pystatus.clock.Clock", "instance": "140691471499160"},
{"markup": "none", "full_text": "16 Jul 14:37 EEST", "urgent": false, "name": "i3pystatus.clock.Clock", "instance": "140691471497088"}
# Test config 2:
status.register('clock', format=('%-d %b %H:%M %Z', 'America/Los_Angeles')) // works
status.register('clock', format=('%a %-d %b %H:%M'), // localtime, should be London but still shows PDT (LA time)
@alexcepoi
alexcepoi / gist:837d4a0dfc54e216f2a443c5bf3955e0
Created April 12, 2016 16:30
i3pystatus bad reported time
**** format='%a %-d %b %H:%M'
% python3 pystatus.py
{"version": 1, "click_events": true}
[
[{"urgent": false, "name": "i3pystatus.clock.Clock", "markup": "none", "full_text": "Tue 12 Apr 12:59", "color": "#2e9ef4", "instance": "140679667622800"}]
% PYTHONPATH=~/i3pystatus/ python3 pystatus.py // master (8aeaab7fa5372b443cc45ef4165d2897dfc38541)
{"version": 1, "click_events": true}
[
[{"instance": "140646587005136", "name": "i3pystatus.clock.Clock", "urgent": false, "color": "#2e9ef4", "markup": "none", "full_text": "Tue 12 Apr 05:59"}]
@alexcepoi
alexcepoi / sep.md
Last active April 14, 2023 05:17
Scrapy Contracts Evolution

This presents some possible improvements for scrapy contracts. They can be potentially all implemented, but curious which are good/bad ideas. All of them could potentially break existing custom contracts.

1. One callback can have multiple @url contracts

... or multiple contracts which generate requests in general

def parse_response(self, response):
    """
    @url http://example.org/foo
[nosetests]
# verbosity=1
with-doctest=1
{
"817772400": {
"deletions": 0,
"files": 0,
"insertions": 0,
"commits": 0,
"lines": 0,
"total": 0
},
"825634800": {
{"1101855600": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "1038697200": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "1283292000": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "975625200": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "1109631600": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "1180648800": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "959810400": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "849394800": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "999295200": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "912466800": {"deletions": 0, "files": 0, "insertions": 0, "commits": 0, "lines": 0, "total": 0}, "1314828000": {"deletions": 1747, "fil