Skip to content

Instantly share code, notes, and snippets.

View muxueqz's full-sized avatar

muxueqz muxueqz

View GitHub Profile
@muxueqz
muxueqz / get_page.py
Created November 2, 2020 07:37
get_page.py
#coding=utf-8
import sys
#str = raw_input()
#print str
def get_page(page_num, nums):
items = range(100)
start_num = page_num * nums
result = list(range(len(items)))[start_num:start_num + nums]
return result
[{"timestamp":1591894800,"avgBlockTimeDaily":"8171.42","avgBlockTimeWeekly":"10549.97"},{"timestamp":1591898400,"avgBlockTimeDaily":"8106.59","avgBlockTimeWeekly":"10532.48"},{"timestamp":1591902000,"avgBlockTimeDaily":"8091.85","avgBlockTimeWeekly":"10513.77"},{"timestamp":1591905600,"avgBlockTimeDaily":"8083.98","avgBlockTimeWeekly":"10503.70"},{"timestamp":1591909200,"avgBlockTimeDaily":"8089.07","avgBlockTimeWeekly":"10494.66"},{"timestamp":1591912800,"avgBlockTimeDaily":"8109.47","avgBlockTimeWeekly":"10477.86"},{"timestamp":1591916400,"avgBlockTimeDaily":"8088.89","avgBlockTimeWeekly":"10420.21"},{"timestamp":1591920000,"avgBlockTimeDaily":"8086.26","avgBlockTimeWeekly":"10372.53"},{"timestamp":1591923600,"avgBlockTimeDaily":"8092.61","avgBlockTimeWeekly":"10327.04"},{"timestamp":1591927200,"avgBlockTimeDaily":"8076.50","avgBlockTimeWeekly":"10276.87"},{"timestamp":1591930800,"avgBlockTimeDaily":"8057.84","avgBlockTimeWeekly":"10252.04"},{"timestamp":1591934400,"avgBlockTimeDaily
!(function (e) {
function r(r) {
for (
var n, a, f = r[0], u = r[1], i = r[2], l = 0, b = [];
l < f.length;
l++
)
(a = f[l]),
Object.prototype.hasOwnProperty.call(o, a) && o[a] && b.push(o[a][0]),
(o[a] = 0);
Executing: /opt/debugger/ckb-debugger --tx-file tx.json --script-group-type type -i 0 -e input
Run result: Err(ParseError)
Total cycles consumed: 619
Transfer cycles: 80, running cycles: 539
Machine status: pc : 0x 10090
zero: 0x 0 ra : 0x 100DA sp : 0x 3FFF98 gp : 0x 0
tp : 0x 0 t0 : 0x 0 t1 : 0x 0 t2 : 0x 0
s0 : 0x 0 s1 : 0x 0 a0 : 0x 3FFFAC a1 : 0x 3FFFA0
a2 : 0x 0 a3 : 0x 0 a4 : 0x 0 a5 : 0x 0
root@42a0bbb23032:/app# ruby runner.rb /app/pkg/ckb_syscall_import 0x10000000
Executing: ckb-standalone-debugger/bins/target/release/ckb-debugger --tx-file tx.json --script-group-type type -i 0 -e input
Run result: Err(InvalidEcall(0))
Total cycles consumed: 570
Transfer cycles: 60, running cycles: 510
Machine status: pc : 0x 100CA
zero: 0x 0 ra : 0x 0 sp : 0x 3FFFF8 gp : 0x 0
tp : 0x 0 t0 : 0x 0 t1 : 0x 0 t2 : 0x 0
s0 : 0x 0 s1 : 0x 0 a0 : 0x 100D0 a1 : 0x 0
{'count': 29, 'city': 'Taohuajiang', 'latitude': 28.523609, 'country': 'CN', 'postal': '413400', 'longitude': 112.125282}
{'count': 7, 'city': 'Baltimore', 'latitude': 39.290379, 'country': 'US', 'postal': '21201', 'longitude': -76.61219}
{'count': 2, 'city': 'Young Harris', 'latitude': 34.93417, 'country': 'US', 'postal': '30582', 'longitude': -83.847778}
{'count': 3, 'city': 'Hornsby', 'latitude': -33.702438, 'country': 'AU', 'postal': '2077', 'longitude': 151.099304}
{'count': 7, 'city': 'Riyadh', 'latitude': 24.687731, 'country': 'SA', 'postal': '12233', 'longitude': 46.721851}
{'count': 31, 'city': 'Taoyuan', 'latitude': 24.993679, 'country': 'TW', 'postal': '330', 'longitude': 121.296959}
{'count': 1, 'city': 'Sierville', 'latitude': 49.590599, 'country': 'FR', 'postal': '76690', 'longitude': 1.0372}
{'count': 7, 'city': 'Huainan', 'latitude': 32.626389, 'country': 'CN', 'postal': '232000', 'longitude': 116.996941}
# Config generated by `ckb init --chain testnet`
data_dir = "data"
[chain]
# Choose the kind of chains to run, possible values:
# - { file = "specs/dev.toml" }
# - { bundled = "specs/testnet.toml" }
# - { bundled = "specs/mainnet.toml" }
spec = { file = "specs/testnet.toml" }
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
diff -r /tmp/cache/orig-version/js/common/api/attester.js ./js/common/api/attester.js
11c11,12
< const r = await Attester.pubCall(`pub/${email}`);
---
> // const r = await Attester.pubCall(`pub/${email}`);
> const r = await Attester.pubCall(`by-email/${email}`);
100c101
< return await Api.apiCall('https://flowcrypt.com/attester/', resource, data, typeof data === 'string' ? 'TEXT' : undefined, undefined, undefined, 'xhr', method);
---
> return await Api.apiCall('https://keys.openpgp.org/vks/v1/', resource, data, typeof data === 'string' ? 'TEXT' : undefined, undefined, undefined, 'xhr', method);