Skip to content

Instantly share code, notes, and snippets.

View langyo's full-sized avatar
💫
The world open itself before those with noble hearts.

伊欧 langyo

💫
The world open itself before those with noble hearts.
View GitHub Profile
@carlodaniele
carlodaniele / block.json
Created September 28, 2022 14:56
An example Gutenberg block for Kinsta readers
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "ka-example-block/ka-example-block",
"version": "0.1.0",
"title": "Kinsta Academy Block",
"category": "widgets",
"icon": "superhero-alt",
"description": "An example block for Kinsta Academy students",
"supports": {
@yojohanshinwataikei
yojohanshinwataikei / main.ts
Last active March 25, 2024 01:23
Arcaea score prober backend
import fs = require("fs-extra")
import path = require("path")
import net = require("net")
import https = require("https")
import child = require("child_process")
import util = require("util")
import WebSocket = require("ws")
import brotli = require("brotli")
import mysql2 = require("mysql2/promise")
import sqlite3 = require("better-sqlite3")
@sindresorhus
sindresorhus / esm-package.md
Last active May 3, 2024 10:19
Pure ESM package

Pure ESM package

The package that linked you 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.
<template>
<main>
<p v-if="loading">Loading todos...</p>
<p v-else-if="loadError">Error loading todos: {{ loadError }}</p>
<template v-else>
<p>Add a todo: <input v-model="newTodo"> <button @click="addTodo">add</button></p>
<ul>
<li v-for="todo in todos" :key="todo.localId"><button @click="removeTodo(todo)">Remove</button> {{ todo.content }}</li>
</ul>
</template>
@sum-catnip
sum-catnip / inject.rs
Created February 18, 2020 16:41
rust simple dll injection
use std::io;
use std::ptr;
use std::mem;
use std::io::Error;
use std::io::ErrorKind;
use std::path::Path;
use std::ffi::CString;
use winapi::um::winnt::HANDLE;
use winapi::um::memoryapi as wmem;
<?php
// https://gist.github.com/esterTion/c673a5e2547cd54c202f129babaf601d
/*
This code is now maintained by yojohanshinwataikei solely
esterTion has retired from this project
*/
chdir(__DIR__);
require_once __DIR__ . '/../webpthumb/Workerman-master/Autoloader.php';
@gaomeng1900
gaomeng1900 / llvm-wasm.sh
Last active November 17, 2022 16:35
使用LLVM编译wasm
# 编译使用LLVM的实验性WASM编译器
# 编译支持
# [Cloudflare Workers WebAssembly Demo](http://www.joyk.com/dig/detail/1538467210844002)
# [lldでwasmをリンクするまで](https://qiita.com/chikoski/items/41853dfb2afdec52e7d1)
# [Using LLVM from Rust to generate WebAssembly binaries](https://medium.com/@jayphelps/using-llvm-from-rust-to-generate-webassembly-93e8c193fdb4)
# [Notes on working with C and WebAssembly](https://aransentin.github.io/cwasm/)
# llvm编译文档
# https://clang.llvm.org/get_started.html
@tiernan
tiernan / serviceworker.d.ts
Last active June 10, 2023 10:59
Service Worker Typings to Supplement lib.webworker.ts
/**
* Copyright (c) 2018, Tiernan Cridland
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
* granted, provided that the above copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
@noyobo
noyobo / decompress-tgz.js
Last active June 1, 2022 03:20
decompress tgz in nodejs
var fs = require('fs');
var zlib = require('zlib');
var path = require('path');
var tar = require('tar');
var mkdirp = require('mkdirp');
// 全解压
fs.createReadStream(path.resolve('./ice-2.0.50.tgz'))
.on('error', console.log)
.pipe(zlib.Unzip())
@ithinkihaveacat
ithinkihaveacat / service-worker.d.ts
Last active May 1, 2024 01:04 — forked from tiernan/service-worker.d.ts
Typings for using the Service Worker API with TypeScript
/**
* Copyright (c) 2016, Tiernan Cridland
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
* granted, provided that the above copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR