Skip to content

Instantly share code, notes, and snippets.

Yumin Gui medmin

Block or report user

Report or block medmin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@medmin
medmin / sendmail.py
Created Sep 18, 2019
Send Email with gmail account in aws lambda
View sendmail.py
import json
import smtplib, ssl
port = 587 # For starttls
smtp_server = "smtp.gmail.com"
sender_email = "xxxxx@gmail.com"
receiver_email = "xxxxxx@gmail.com"
password = "xxxxxx"
message = """\
Subject: Test
View gist:bbb383dfd13c7e3490f030efcf1469d3
package topic180313;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.NoSuchAlgorithmException;
@medmin
medmin / gist:72d6627b9519abd9067d8b5af4119532
Created Mar 10, 2019
Nodejs (expressjs and Koajs) Mongoose Connect Config
View gist:72d6627b9519abd9067d8b5af4119532
const mongoose = require('mongoose');
mongoose.connect(`mongodb://dbUser:${encodeURIComponent('dbUserName')}@ds012889.mlab.com:12889/mLabDBname`, { useNewUrlParser: true });
const db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function () {
console.log('db ok');
@medmin
medmin / jwtRS256.sh
Created Dec 22, 2018 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
View jwtRS256.sh
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@medmin
medmin / IDCard.java
Created Jul 18, 2017 — forked from JetXing/IDCard.java
java, 身份证号的正则表达式, regular expression for ID card
View IDCard.java
package com.gitcafe.android.base.fragment;
import android.util.Log;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Hashtable;
import java.util.regex.Matcher;
@medmin
medmin / SaveAllWeixinMessages-SQL
Last active Apr 29, 2017
SaveAllWeixinMessages
View SaveAllWeixinMessages-SQL
CREATE TABLE `myTable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`msgID` BIGINT UNSIGNED NOT NULL,
`msgRaw` TEXT NOT NULL,
`msgSrcName` varchar(255) NOT NULL,
`msgSrcID` varchar(255) NOT NULL,
`msgTextContent` TEXT NOT NULL,
`msgCreatedDate` DATE NOT NULL,
`msgCreatedDatetime` DATETIME NOT NULL,
`DaysToExpirationDate` int(11) NOT NULL DEFAULT 90,
@medmin
medmin / wxpy_group.py
Created Apr 26, 2017 — forked from youfou/ad_urls.json
响应好友请求 / 自动聊天 / 限制频率 / 邀请入群 / 远程群管理 / 新人欢迎消息 / 关键词问答 / 发心跳 / 远程命令 / 远程执行代码
View wxpy_group.py
#!/usr/bin/env python3
# coding: utf-8
"""
wxpy 机器人正在使用的所有代码
可能需要安装开发分支的 wxpy
pip3 install -U git+https://github.com/youfou/wxpy.git@develop
You can’t perform that action at this time.