Skip to content

Instantly share code, notes, and snippets.

View ekibun's full-sized avatar
🕊️
GUGUGU

ekibun ekibun

🕊️
GUGUGU
View GitHub Profile
@ekibun
ekibun / Bgm.svg
Last active November 30, 2021 04:51
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -e
if [ $1 == "ln" ]; then
tgtdir=$( dirname "$3" )
tgtbase=$( basename "$3" )
windir=$( wslpath -w "$tgtdir" )
cmd.exe /c mklink /J "$windir\\$tgtbase" "$( wslpath -w "$2" )"
else
# https://github.com/microsoft/WSL/issues/6420
const P = "BC";
const B = "AAABBBBCCCCBBB";
console.log(`P=${P}\nB=${B}`);
function testB(b) {
if (!b) return 0;
if (b.length < 3) return -1;
let min = -2;
let s = 0;
<!--
* @Description: image clip
* @Author: ekibun
* @Date: 2020-07-31 22:39:41
* @LastEditors: ekibun
* @LastEditTime: 2020-08-01 22:51:51
-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div style="user-select: none;">
@ekibun
ekibun / queue.js
Created November 21, 2019 11:39
async pool
/*
* @Description: async pool
* @Author: ekibun
* @Date: 2019-11-21 15:30:04
* @LastEditors: ekibun
* @LastEditTime: 2019-11-21 19:33:27
*/
async function queue(fetchs, run, num = 2) {
await Promise.all(new Array(num).fill(0).map(async () => {
while (fetchs.length) await run(fetchs.shift())
<!--
* @Description: banner
* @Author: ekibun
* @Date: 2019-09-17 14:47:44
* @LastEditors: ekibun
* @LastEditTime: 2019-09-18 16:27:24
-->
<!DOCTYPE html>
<html>
@ekibun
ekibun / urlquery.js
Created July 9, 2019 11:00
urlquery
/*
* @Description: url query extract
* @Author: ekibun
* @Date: 2019-07-09 18:02:36
* @LastEditors: ekibun
* @LastEditTime: 2019-07-09 18:55:49
*/
const asPath = 'http://localhost:3000/products?page=1&category=5d079b&power=2'
console.log(Object.assign({}, ...(asPath.split('?')[1] || "")
.split('&').filter(item => item).map(item => item.split('='))
@ekibun
ekibun / auth.js
Last active May 23, 2020 15:43
auth demo for bgm.tv
/*
* @Description: auth demo for bgm.tv
* @Author: ekibun
* @Date: 2019-06-30 16:42:16
* @LastEditors: ekibun
* @LastEditTime: 2019-07-08 01:41:10
*/
const axios = require('axios')
const cheerio = require('cheerio')
const qs = require('qs')
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r83/three.min.js'></script>
<script src='https://mrdoob.github.io/stats.js/build/stats.min.js'></script>
<!-- without worker <script src='https://d3js.org/d3.v5.min.js'></script> -->
<style>