Skip to content

Instantly share code, notes, and snippets.

View nbwsc's full-sized avatar

Wangshichao nbwsc

  • China
View GitHub Profile
@nbwsc
nbwsc / maxp_api_doc.md
Created December 28, 2021 10:36
maxpAPI文档
@nbwsc
nbwsc / lowpass_filter.js
Created July 4, 2018 05:05
低通滤波
class LowPassFilter{
convolution(pixels, weights, width, height) {
const side = Math.round(Math.sqrt(weights.length));
const halfSide = Math.floor(side / 2);
const src = pixels;
const canvasWidth = width;
const canvasHeight = height;
const outputData = [];
for (let y = 0; y < canvasHeight; y++) {
for (let x = 0; x < canvasWidth; x++) {
@nbwsc
nbwsc / easing.js
Created July 2, 2018 12:24 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
<?php
// APPID (开户邮件中可查看)
define("APP_ID", "YOUR_APP_ID");
// 商户号 (开户邮件中可查看)
define("MCH_ID", "YOUR_MCH_ID");
// 商户支付密钥 (https://pay.weixin.qq.com/index.php/account/api_cert)
define("APP_KEY", "YOUR_APP_KEY");
// get prepay id
$prepay_id = generatePrepayId(APP_ID, MCH_ID);
// re-sign it
@nbwsc
nbwsc / nextTick.js
Created January 8, 2018 03:27 — forked from mmalecki/nextTick.js
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}