Skip to content

Instantly share code, notes, and snippets.

@hmli
hmli / aes_encryption.go
Created June 22, 2017 10:05 — forked from stupidbodo/aes_encryption.go
AES Encryption Example in Golang
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
package log
import (
"go.uber.org/zap"
"fmt"
"go.uber.org/zap/zapcore"
"time"
)
var Log *zap.SugaredLogger
@hmli
hmli / payment.py
Last active July 23, 2016 06:49
算钱
# -*- coding: utf8 -*-
from operator import attrgetter
class Member:
def __init__(self, name, paid=0):
self.name = name
self.paid = paid
def pay(self, num):
self.paid += num
@hmli
hmli / time.py
Last active August 29, 2015 14:20 — forked from DeronW/time.py
import time
from datetime import datetime, date
# 今天
datetime.datetime.today().date().isoformat()
# 通过日期对象生成时间戳
int(time.mktime(datetime.now().timetuple()))
# 通过时间戳生成日期对象,timestamp 的时间戳以秒为单位