This file contains hidden or 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 <christoph@christophdorn.com> (http://www.christophdorn.com) | |
| /*jshint browser:true, devel:true */ | |
| (function( expose ) { | |
| /** |
This file contains hidden or 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 hidden or 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== |
This file contains hidden or 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 omitDeep(collection, excludeKeys) { | |
| function omitFn(value) { | |
| if (value && typeof value === 'object') { | |
| excludeKeys.forEach((key) => { | |
| delete value[key]; | |
| }); | |
| } | |
| } |
This file contains hidden or 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 MY_DOMAIN = "example.com" | |
| const START_PAGE = "https://www.notion.so/xxxx/xxxxx" | |
| addEventListener('fetch', event => { | |
| event.respondWith(fetchAndApply(event.request)) | |
| }) | |
| const corsHeaders = { | |
| "Access-Control-Allow-Origin": "*", | |
| "Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS", |
This file contains hidden or 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 args = process.argv.slice(2); | |
| if (args.length === 0) { | |
| console.error('请输入要删除的 tag'); | |
| process.exit(1); | |
| } | |
| const tag = args[0]; | |
| await $`git tag -d ${tag}`; | |
| await $`git push origin :refs/tags/${tag}`; |
This file contains hidden or 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 fs = require("fs"); | |
| const zipdata = fs.createReadStream("1.zip"); | |
| const { zip, tar } = require("compressing"); | |
| async function getTarReadStream(download) { | |
| return new Promise((resolve, reject) => { | |
| function onEntry(header, stream, next) { | |
| if (header.type === "file" && header.name.endsWith(".tar")) { | |
| resolve(stream); | |
| return; | |
| } |
This file contains hidden or 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
| #!/bin/sh | |
| echo "restart dnscrypt-proxy..." | |
| sudo brew services restart dnscrypt-proxy | |
| echo "restart dnsmasq..." | |
| sudo brew services restart dnsmasq |
This file contains hidden or 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
| pid | story | vote_yes | vote_no | |
|---|---|---|---|---|
| 3 | Gauss didn’t discover the normal distribution, nature conformed to his will. | 267 | 49 | |
| 4 | Gauss can trisect an angle with a straightedge and compass. | 33 | 8 | |
| 5 | Gauss can get to the other side of a Möbius strip. | 269 | 39 | |
| 6 | “Uncountably Infinite” was a phrase coined to explain the intelligence of Gauss. | 53 | 14 | |
| 7 | There are no Fermat Primes greater than 65,537 because Gauss saw that Fermat was on to something, and well…he put an end to that. | 82 | 8 | |
| 8 | For Gauss, arithmetic is consistent AND complete. | 41 | 5 | |
| 9 | It only takes Gauss 4 minutes to sing “Aleph-Null Bottles of Beer on the Wall”. | 175 | 36 | |
| 10 | When Gauss tells you that he’s lying, he’s telling the truth. | 347 | 25 | |
| 11 | Gauss once played himself in a zero-sum game and won $50. | 440 | 28 |
This file contains hidden or 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 fs = require('fs'); | |
| var readline = require('readline'); | |
| var stream = require('stream'); | |
| const buf = fs.readFileSync('./1.txt'); | |
| var bufferStream = new stream.PassThrough(); | |
| bufferStream.end(buf); | |
| var rl = readline.createInterface({ |