-
Add local domain to
/etc/hosts
:127.0.0.1 my-project.dev
-
Install mkcert
-
Create certificate for this domain:
➜ mkcert my-project.dev
This file contains 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
var express = require('express'); | |
var sys = require('sys'); | |
var oauth = require('oauth'); | |
var app = express.createServer(); | |
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY"; | |
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET"; | |
function consumer() { |
This file contains 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 json | |
import smtplib, ssl | |
port = 587 # For starttls | |
smtp_server = "smtp.gmail.com" | |
sender_email = "[email protected]" | |
receiver_email = "[email protected]" | |
password = "xxxxxx" | |
message = """\ | |
Subject: Test |
This file contains 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 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; |
This file contains 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
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'); |
This file contains 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
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 |
This file contains 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 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; |
This file contains 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
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, |
This file contains 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
#!/usr/bin/env python3 | |
# coding: utf-8 | |
""" | |
wxpy 机器人正在使用的所有代码 | |
可能需要安装开发分支的 wxpy | |
pip3 install -U git+https://github.com/youfou/wxpy.git@develop |