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 { | |
Chromeless | |
} = require('chromeless') | |
const fs = require('fs') | |
const myConsole = console | |
const bookName = process.argv[2] | |
const bookInfoList = [] |
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
class SoundManager { | |
private static instance: SoundManager | |
private static IS_MUTE_SYMBOL = 'isMute' | |
private static BGM_VOLUME = 'bgmVolume' | |
private static EFFECT_VOLUME = 'effectVolume' | |
static getInstance() { | |
if (!SoundManager.instance) { | |
new SoundManager() |
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 = [1,2,3] | |
arr.forEach(async function (value, index) { | |
await new Promise((resolve, reject) => { | |
setTimeout(function () { | |
resolve(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
///<reference path="./utils/array.ts" /> | |
/** | |
* 控制场景的切换 | |
* 与 Main 协同工作 | |
*/ | |
class SceneManager { | |
private static instance: SceneManager = null | |
static getInstance() { |
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
/** | |
* 点击收件箱,控制台运行代码,删除所有收件箱邮件 | |
* 删除与某个账号的往来邮件:找到并打开与该账号的一封邮件,鼠标 hover 到收件人,点击往来邮件,然后运行下面的代码 | |
* | |
* 根据网络情况,可以调节下方定时器的间隔 | |
* (顺便发现一个 Bug: Chrome 67.0.3396.99 下 setTimeout 与 setInterval 内无法正常使用便捷选择器 $) | |
*/ | |
setInterval(function () { | |
document.getElementById('mainFrame').contentDocument.getElementsByClassName('o_title2')[0].previousSibling.children[0].click(); | |
document.getElementById('mainFrame').contentDocument.getElementById('quick_completelydel').click(); |
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 GAME_CONSTS = { | |
BOARD_WIDTH: 10, | |
BOARD_HEIGHT: 10, | |
STAR_COLOR_CODE_START: 1, | |
STAR_COLOR_CODE_END: 4, | |
scoreCounter (starNum) { | |
return starNum * starNum * 5 | |
}, | |
remainScoreCounter (remainNum) { | |
return remainNum * 20 |
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
upstream nodejs8000 { | |
server 127.0.0.1:8000; | |
keepalive 64; | |
} | |
server { | |
listen 80; | |
listen 443; | |
server_name web-dev.youguogame.com; | |
ssl on; |
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
<!DOCTYPE html> | |
<html lang="zh_CN"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Angular Core Implementation</title> | |
</head> |
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
/** | |
* Requires node v0.7.7 or greater. | |
* | |
* To connect: $ curl -sSNT. localhost:8000 | |
*/ | |
var http = require('http') | |
, repl = require('repl') | |
, buf0 = new Buffer([0]) |
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 net = require('net') | |
var sock = net.connect(1337) | |
process.stdin.pipe(sock) | |
sock.pipe(process.stdout) | |
sock.on('connect', function () { | |
process.stdin.resume(); | |
process.stdin.setRawMode(true) |