[TOC]
截止 10 Apr, 2020 ,
微信小程序的云函数仅支持 Node.js 语言,函数在生产环境执行于 CentOS 7.2
的 Node.js 8.9
,因此若有二进制模块使用需求请注意相关配置。
现以 gRPC 为例说明。
// Website you intended to retrieve for users. | |
const upstream = 'api.openai.com' | |
// Custom pathname for the upstream website. | |
const upstream_path = '/' | |
// Website you intended to retrieve for users using mobile devices. | |
const upstream_mobile = upstream | |
// Countries and regions where you wish to suspend your service. |
Full documentation: https://ffmpeg.org/ffmpeg.html
ffmpeg -i input.mkv
track indexes are zero-based.
import cv2 | |
import time | |
import math | |
import numpy as np | |
import tensorflow as tf | |
class SsdAnchorsCalculatorOptions: | |
def __init__(self, input_size_width, input_size_height, min_scale, max_scale | |
, num_layers, feature_map_width, feature_map_height | |
, strides, aspect_ratios, anchor_offset_x=0.5, anchor_offset_y=0.5 |
背景: 折腾了一整个周末,终于把用通过微信进行获取用户信息,以用来进行账号注册登录的问题搞定了, 因为面对的问题比较棘手: 希望通过微信订阅号获取用户信息授权,在自己开放的网站(所谓第三方网站)拿到用户信息, 所以在解决问题的过程中,顺便把自己期望实现的方式,以及现有的方式也稍微了解了一些, 所以趁此机会做一个整理。 因为朋友的网站是 php 开发的,所以下面的代码会以 php 进行举例,尽管我对 php 并不熟悉, 但是现在懒得重新去实现一遍了, 后面再说吧, 如果有后面的话。 其实其他语言理论上可以很容易类比, 因为微信的这些接口都是 restful 的 http 接口。
微信授权登陆, 从使用入口来说,主要是 PC 端网站, 移动端网站和 APP。 这里的“移动端网站”是指从微信浏览器打开的网站,如果从手机浏览器打开, 那么只能与PC端的授权方式一样(实际上操作很麻烦) 基本的授权方式如下:
以上两种方式基本可以通过微信开放平台实现。
import argparse | |
import os | |
import numpy as np | |
import math | |
import torchvision.transforms as transforms | |
from torchvision.utils import save_image | |
from torch.utils.data import DataLoader | |
from torchvision import datasets |
'use strict' | |
function HDMVPGS (ctx) { | |
this.ctx = ctx || document.createElement('canvas').getContext('2d') | |
this.lastVisibleSegment = null | |
this.segments = [] | |
this.loaded = false | |
} | |
HDMVPGS.prototype.loadBuffer = function (arraybuffer) { |
### NOT A SCRIPT, JUST A REFERENCE! | |
# install dante-server | |
sudo apt update | |
sudo apt install dante-server | |
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04: | |
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build5_amd64.deb | |
# or older version: | |
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet"> | |
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet"> | |
</head> | |
<style> | |
#app { |
# coding:utf-8 | |
from elasticsearch import Elasticsearch | |
import json | |
# Define config | |
host = "127.0.0.1" | |
port = 9200 | |
timeout = 1000 | |
index = "index" |