I hereby claim:
- I am yegle on github.
- I am yegle (https://keybase.io/yegle) on keybase.
- I have a public key ASA_sLGmpOa5Duyf2sYyu-22gA5UrZf_4dlrv7FG6619FAo
To claim this, I am signing this object:
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "io" | |
| "log" | |
| "net/http" | |
| "strconv" | |
| "time" |
| # Caveat: | |
| # 1. query_response support regex capture group, but you have to write expect/send in the same YAML item. | |
| # 2. When send the "send" line, Blackbox Exporter will automatically add a \n. | |
| transmission_rpc: | |
| prober: tcp | |
| timeout: 30s | |
| tcp: | |
| query_response: | |
| - send: "GET /transmission/rpc/ HTTP/1.1\r\nAuthorization: Basic YOUR_BASIC_AUTH_HEADER\r\n\r" |
| $ curl -I https://www.autonomous.ai -H 'accept-language: en,zh-CN;q=0.9,zh;q=0.8' | |
| HTTP/2 500 | |
| server: nginx | |
| date: Wed, 27 May 2020 06:46:20 GMT | |
| content-type: text/html; charset=utf-8 | |
| content-length: 58788 | |
| set-cookie: lang=zh-CN; Max-Age=315360000; Path=/; Expires=Sat, 25 May 2030 06:46:20 GMT | |
| access-control-allow-origin: * | |
| access-control-allow-methods: GET, POST, OPTIONS, PUT, PATCH, DELETE | |
| access-control-allow-headers: X-Requested-With,content-type |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Looping over a tuple is faster than looping over a list in Python2
In Python2:
In [1]: def loop_list():
...: for i in [1, 2, 3]:
...: pass
...:
In [2]: def loop_tuple():
| 2014-09-03 open Assets:Vanguard:VXX VXX "NONE" | |
| 2014-09-03 open Expenses:Vanguard:Fee USD | |
| 2014-09-03 open Income:Hooli:Paycheck USD |
| #!/usr/bin/env bash | |
| echo "Because gist doesn't support directory" | |
| dir=$(dirname "$0") | |
| mkdir -p "$dir/stmts/Assets/US/BoA" | |
| touch "$dir/stmts/Assets/US/BoA/2015-01-31.statement" |
| mkdir -p confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14 |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| class MyList(list): | |
| def __init__(self, raw_list, start=None, stop=None): | |
| self.raw_list = raw_list | |
| self.start = start or 0 | |
| self.stop = stop or len(raw_list)-1 |