Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # coding: utf-8 | |
| # py2 origin author lrdcq | |
| # usage python3 unwxapkg.py filename | |
| __author__ = 'Integ: https://github.com./integ' | |
| import sys, os | |
| import struct | |
| class WxapkgFile(object): |
| package reverse_proxy | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "github.com/viggin/svc-api-gateway/internal/models" | |
| "github.com/gin-gonic/gin" | |
| "github.com/google/uuid" | |
| "github.com/palantir/stacktrace" | |
| "github.com/sirupsen/logrus" |
| #!/bin/sh | |
| # | |
| # Orinally made by Lovell Fuller for sharp | |
| # https://github.com/lovell/sharp | |
| # | |
| # Usage: | |
| # curl -s https://gist.github.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash - | |
| # |
| version: '3' | |
| # Variables to fill in: | |
| # Line 23: <LETSENCRYPT_MAIL_ADDRESS> - your mail address for contact with Let's Encrypt | |
| # Line 36: <TRAEFIK_DASHBOARD_ADMIN_PASSWORD> - MD5 hash of your password (use http://www.htaccesstools.com/htpasswd-generator/) | |
| # Line 54: <POSTGRES_PASSWORD> - the password for the postgres db. Use the same during mastodon:setup! | |
| # Lines 31, 86, 111: <DOMAIN> - e.g. social.yourdomain.com (Must have an A record pointing to your box' IP) (AAAA for IPv6 ;) | |
| services: | |
| traefik: |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "hash/fnv" | |
| "io" | |
| "os" | |
| ) |
| package client | |
| import ( | |
| "context" | |
| "crypto/md5" | |
| "crypto/tls" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "net" |
| # use with: logging.config.dictConfig(yaml.load(open('logging.yaml', 'r'))) | |
| # Formatters detailed here: http://docs.python.org/2/library/logging.html#logrecord-attributes | |
| version: 1 | |
| formatters: | |
| simple: | |
| format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
| detail: | |
| format: '%(asctime)s - %(levelname)s - File: %(filename)s - %(funcName)s() - Line: %(lineno)d - %(message)s' |
| #!/usr/bin/env python | |
| """ | |
| Dummy SMTP server accepting everything and storing message to disk. | |
| Useful for unit testing. | |
| """ | |
| import asyncore | |
| import time | |
| import os | |
| import os.path |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on 2014-02-09 | |
| __author__ = DuanShiMing | |
| __mail__ = [email protected] | |
| dnspod动态dns更新 | |
| 五分钟更新一次, 运行crontab -e, 编辑: | |
| */5 * * * * python /home/lenye/dnspod_ddns.py |