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
[target.'cfg(target_os = "windows")'.dependencies.windows] | |
version = "0.58" | |
features = [ | |
"Foundation", | |
"Media", | |
"Win32_Foundation", | |
"Win32_Storage_EnhancedStorage", | |
"Win32_System_LibraryLoader", | |
"Win32_System_Com", | |
"Win32_System_Com_StructuredStorage", |
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 { ReadableStream, WritableStream } from 'stream/web'; | |
async function measure(name, func) { | |
for (let i = 0; i < 5; i++) { | |
const start = Date.now(); | |
await func(); | |
console.log(`${name}: ${Date.now() - start}ms`); | |
} | |
} |
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
<canvas id="canvas"></canvas> | |
<script> | |
(async () => { | |
const response = await fetch('./0000.bmp'); | |
const arraybuffer = await response.arrayBuffer(); | |
const dataview = new DataView(arraybuffer); | |
const offset = dataview.getUint32(10, true); | |
const width = dataview.getUint32(18, true); | |
let height = dataview.getInt32(22, true); |
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
const net = require("net"); | |
const http = require("http"); | |
const https = require("https"); | |
const http2 = require("http2"); | |
const req = https.request({ | |
method: "CONNECT", | |
host: "server", | |
port: 443, | |
path: "magic.string" |
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
#include <functional> | |
#include <iostream> | |
template <class F> | |
struct wrapper { | |
wrapper(F&& f) | |
: f(std::forward<F>(f)) { } | |
std::decay_t<F> f; | |
}; |
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
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | |
return new (P || (P = Promise))(function (resolve, reject) { | |
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | |
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } | |
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | |
step((generator = generator.apply(thisArg, _arguments)).next()); | |
}); | |
}; | |
Promise.delay = function (time) { | |
return new Promise(function (resolve) { |
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
public class NlsEncoding : Encoding | |
{ | |
public struct Range | |
{ | |
public readonly byte Start; | |
public readonly byte End; | |
public Range(byte start, byte end) | |
{ | |
Start = start; |
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
using Microsoft.Graphics.Canvas; | |
using Microsoft.Graphics.Canvas.Brushes; | |
using Microsoft.Graphics.Canvas.Effects; | |
using Microsoft.Graphics.Canvas.Text; | |
using Microsoft.Graphics.Canvas.UI; | |
using Microsoft.Graphics.Canvas.UI.Xaml; | |
using System; | |
using System.Collections.Generic; | |
using Windows.Foundation; | |
using Windows.Graphics.Display; |
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
// ==UserScript== | |
// @id downloadEnhancer | |
// @name Download Dialog Enhancer | |
// @version 1.6.8 | |
// @namespace simon | |
// @author Simon Chan | |
// @description Add copying link, saving as, encoding conversion and renaming functions to download dialog. | |
// @include chrome://browser/content/browser.xul | |
// @include chrome://mozapps/content/downloads/unknownContentType.xul | |
// @run-at document-end |
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
// ==UserScript== | |
// @id tiebaRecentImages | |
// @name Tieba Recent Images | |
// @version 1.0 | |
// @namespace simon | |
// @author Simon Chan | |
// @description Show recent used images when hover on Emoji button. | |
// @include http://tieba.baidu.com/* | |
// @run-at document-end | |
// @grant GM_getValue |
NewerOlder