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 filesize from 'filesize' | |
import crypto from 'crypto' | |
function testIt(buffer: Buffer) { | |
console.log("========") | |
console.log(`原始 buffer 长度`, filesize.filesize(buffer.byteLength)); | |
const stringified = JSON.stringify(buffer) | |
if (stringified.length < 200) { | |
console.log(`原始数据`, buffer); | |
console.log(`序列化结果:`, stringified); |
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 { js } = require('@ast-grep/napi'); | |
const MagicString = require('magic-string').default; | |
/** | |
* Replace the local variable name of the import statement | |
*/ | |
exports.replaceImportDefault = (source, pkgName, expectLocalName) => { | |
const magic = new MagicString(source); | |
const ast = js.parse(source); // 1. parse the source |
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
# one or the other, NOT both | |
[url "https://github"] | |
insteadOf = git://github | |
# or | |
[url "[email protected]:"] | |
insteadOf = git://github |
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 love.conf(t) | |
t.title = "L\195\150VE " .. love._version .. " (" .. love._version_codename .. ")" | |
-- t.gammacorrect = true | |
-- t.modules.audio = false | |
-- t.modules.sound = false | |
-- t.modules.joystick = false | |
-- t.window.resizable = true | |
-- t.window.highdpi = true | |
t.window.width, t.window.height = 1280, 720 | |
t.window.fullscreen = 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
# 1g.txt zero | |
dd if=/dev/zero of=1g.txt bs=1M count=1000 | |
# 10m.txt random | |
dd if=/dev/random of=10m.txt bs=1M count=10 |
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
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
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
#!/usr/bin/env tsx | |
import { config } from 'dotenv'; | |
config(); | |
import { context as createContext, Plugin } from 'esbuild'; | |
import ts from 'typescript'; | |
import { build } from 'esbuild'; | |
import mri from 'mri'; |
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
// Released under MIT license | |
// Copyright (c) 2009-2010 Dominic Baggott | |
// Copyright (c) 2009-2010 Ash Berlin | |
// Copyright (c) 2011 Christoph Dorn <[email protected]> (http://www.christophdorn.com) | |
/*jshint browser:true, devel:true */ | |
(function( expose ) { | |
/** |
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
If (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
Write-Host 'Run this as administrator.' | |
$choice = Read-Host 'Do you want to re-run this as administrator? [y/N]' | |
if ($choice -ne 'y') { | |
exit 1 | |
} | |
$actualScriptRoot = $PSScriptRoot | |
if ((Get-Item $PSCommandPath).Target) { | |
$actualScriptRoot = Split-Path -Parent ((Get-Item $PSCommandPath).Target) | |
} |
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== | |
// @name enableBh | |
// @namespace xxxxx.enableBh | |
// @grant none | |
// @version 1.0 | |
// @match *://www.fundebug.com/* | |
// @run-at document-start | |
// @description 2020/2/28 上午12:16:59 | |
// ==/UserScript== |
NewerOlder