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
@sindresorhus
sindresorhus / esm-package.md
Last active May 17, 2024 14:07
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.
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@revolunet
revolunet / web-audio-fetch-stream.js
Last active May 8, 2024 08:11
Web Audio streaming with fetch API
//
// loads remote file using fetch() streams and "pipe" it to webaudio API
// remote file must have CORS enabled if on another domain
//
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api
//
function play(url) {
var context = new (window.AudioContext || window.webkitAudioContext)();
@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
@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")
@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": {
@neekey
neekey / chrome_extension_get_cookie.js
Created September 8, 2013 15:16
Chrome 插件获取指定域下的Cookie,代码示例
<?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';
@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;
@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