Skip to content

Instantly share code, notes, and snippets.

View xdimh's full-sized avatar
🎯
Focusing

~Refresh xdimh

🎯
Focusing
View GitHub Profile
@zz85
zz85 / otsu.js
Last active February 4, 2022 18:31
Otsu's method - Automatic Histogram Based Image Thresholding
// Read https://en.wikipedia.org/wiki/Otsu%27s_method (added this since JS examples in wikipedia didn't work)
function otsu(histData /* Array of 256 greyscale values */, total /* Total number of pixels */) {
let sum = 0;
for (let t=0 ; t<256 ; t++) sum += t * histData[t];
let sumB = 0;
let wB = 0;
let wF = 0;
@iffy
iffy / .gitignore
Last active May 19, 2025 13:56
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
@sweet-zone
sweet-zone / jumpjump.js
Created January 1, 2018 15:16
跳一跳刷分 Nodejs 版
const crypto = require('crypto')
const axios = require('axios')
const url = 'https://mp.weixin.qq.com/wxagame/wxagame_settlement'
const sessionId = 'your session id'
function getActionData(key, content, iv) {
const clearEncoding = 'utf8'
const cipherEncoding = 'base64'
let cipherChunks = []