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 filesInDirectory = dir => new Promise(resolve => | |
dir.createReader().readEntries(entries => | |
Promise.all(entries.filter(e => e.name[0] !== '.').map(e => | |
e.isDirectory ? | |
filesInDirectory(e) : | |
new Promise(resolve => e.file(resolve)) | |
)) | |
.then(files => [].concat(...files)) | |
.then(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
const customKey = require("../vars").customKey | |
const XORCipher = { | |
encode: function (data) { | |
data = xorStrings(customKey, data); | |
return btoa(data); | |
}, | |
decode: function (data) { | |
data = atob(data); | |
return xorStrings(customKey, data); |
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 wCodeMap = { | |
"0": "sunny", // "晴", | |
"1": "cloudy", // "多云", | |
"2": "overcast", // "阴", | |
"3": "shower", // "阵雨", | |
"4": "thundery-shower", // "雷阵雨", | |
"5": "hail", // "冰雹", | |
"6": "sleet", // "雨夹雪", | |
"7": "drizzle", // "小雨", | |
"8": "rain", // "中雨", |
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 getAssetFromKV = async (event: FetchEvent, options?: Partial<Options>): Promise<Response> => { | |
// Assign any missing options passed in to the default | |
options = Object.assign( | |
{ | |
ASSET_NAMESPACE: __STATIC_CONTENT, | |
ASSET_MANIFEST: __STATIC_CONTENT_MANIFEST, | |
mapRequestToAsset: mapRequestToAsset, | |
cacheControl: defaultCacheControl, | |
defaultMimeType: 'text/plain', | |
}, |
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
@echo off | |
pushd "%~dp0" | |
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt | |
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt | |
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i" |
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 fs = require("fs"); | |
function autoFillZero(str) { | |
return parseInt(str) < 10 ? "0" + str : str; | |
} | |
function generateFolderName() { | |
const today = new Date(); | |
return `${today.getFullYear()}-${autoFillZero(today.getMonth() + 1)}-${autoFillZero(today.getDate())}` | |
} |
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
docker inspect code-server | grep IPAddress | |
docker run -d --restart always --name devport -p 10081:1234 alpine/socat TCP-LISTEN:1234,fork TCP-CONNECT:172.17.0.3:10081 |
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 nodemailer = require("nodemailer"); | |
module.exports.handle = async (event, context, callback) => { | |
console.log("Recieved Request started at " + new Date().getTime()) | |
const transporter = nodemailer.createTransport({ | |
host: "example.com", | |
port: 25, | |
secure: false, // true for 465, false for other ports | |
auth: { |
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 arr = [{"name":"中国大陆","plus":"86"},{"name":"香港地区","plus":"852","afterLength":8,"prefix":"5,6,9"},{"name":"台湾地区","plus":"886","afterLength":9,"prefix":"9"},{"name":"澳门地区","plus":"853","afterLength":8,"prefix":"6"},{"name":"澳大利亚","plus":"61","afterLength":9,"prefix":"4"},{"name":"巴西","plus":"55","afterLength":{"max":11,"min":10}},{"name":"德国","plus":"49","afterLength":{"max":11,"min":10},"prefix":"15,16,17"},{"name":"俄罗斯","plus":"7","afterLength":10,"prefix":"901,902,903,904,905,906,908,909,91,92,93,950,951,952,953,96,98,99"},{"name":"法国","plus":"33","afterLength":9,"prefix":"6,73,74,75,76,77,78"},{"name":"菲律宾","plus":"63","afterLength":10,"prefix":"9"},{"name":"韩国","plus":"82","afterLength":10,"prefix":"1"},{"name":"美国","plus":"1","afterLength":10},{"name":"柬埔寨","plus":"855","afterLength":{"max":10,"min":8},"prefix":"1,38,6,7,8,9"},{"name":"老挝","plus":"856","afterLength":{"max":10,"min":9},"prefix":"20"},{"name":"马来西亚","plus":"60","afterLength":{"max":10,"min":9},"prefix":"1"},{"name":"缅甸","plus":"95","aft |
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 _serialize(form) { | |
var arr = {}; | |
console.log(form.element) | |
for (var i = 0; i < form.elements.length; i++) { | |
var feled = form.elements[i]; | |
switch (feled.type) { | |
case undefined: | |
case 'button': | |
case 'file': | |
case 'reset': |
OlderNewer