Skip to content

Instantly share code, notes, and snippets.

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
@kiethen
kiethen / cp.py
Last active September 13, 2018 07:55
#-*- coding: UTF-8 -*-
import requests
headers = {
'Host': 'szv.122.gov.cn',
'Connection': 'keep-alive',
'Accept': 'application/json, text/javascript, */*; q=0.01',
package main
import (
"fmt"
"regexp"
)
var re = regexp.MustCompile(`\$\{([a-zA-Z0-9]{0,})\}`)
func Substitute(s string, mapping map[string]string) string {
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 = []