This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hex_dump(buf) | |
| for byte=1, #buf, 16 do | |
| local chunk = buf:sub(byte, byte+15) | |
| io.write(string.format('%08X ',byte-1)) | |
| chunk:gsub('.', function (c) io.write(string.format('%02X ',string.byte(c))) end) | |
| io.write(string.rep(' ',3*(16-#chunk))) | |
| io.write(' ',chunk:gsub('%c','.'),"\n") | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- coding: UTF-8 -*- | |
| import requests | |
| headers = { | |
| 'Host': 'szv.122.gov.cn', | |
| 'Connection': 'keep-alive', | |
| 'Accept': 'application/json, text/javascript, */*; q=0.01', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "regexp" | |
| ) | |
| var re = regexp.MustCompile(`\$\{([a-zA-Z0-9]{0,})\}`) | |
| func Substitute(s string, mapping map[string]string) string { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| from datetime import datetime | |
| from flask import json | |
| from flask_sqlalchemy import BaseQuery | |
| from sqlalchemy.ext.declarative import DeclarativeMeta | |
| def alchemy_encoder(revisit_self=False, include_fields=[], replace_fields={}): | |
| _visited_objs = [] |