javascript

我在GitHub上找到了这些游戏项目,刺激!

情到浓时终转凉″ 提交于 2021-02-20 11:36:49
作者:JackTian 来源:公众号「杰哥的IT之旅」 ID:Jake_Internet 大家好,我是JackTian。 当你学习、工作累了,趁休息时间娱乐放松一下,通过用游戏的方式来学习技术,那么 GitHub 上这些好玩的开源项目小游戏是最适合不过了。 首先,我们来看一下这张图,可快速了解这篇文章中所涉及到的 23 个关于游戏方面的开源项目。 Games on GitHub 这个开源项目作者收集了托管在 GitHub 上的开源游戏以及跟游戏相关的项目列表,所含的项目类型众多,游戏种类包括教育类、浏览器类等,还包括一些开源的游戏引擎等等; 该项目的目录: 具体细节就不逐一点开给大家演示了,感兴趣的朋友去看看。 GitHub 地址:https://github.com/leereilly/games vim-game-code-break 这个项目是 Vim 插件版本的打豆豆。 将其放在您的.vimrc中: Plug 'johngrib/vim-game-code-break' 然后在Vim中运行以下命令: :source % :PlugInstall 装上这个插件输入 :VimGameCodeBreak ,即可开始游戏。 功能介绍 h、l 键是控制左右方向; space 键是发球; ` 键是作弊键; ] 键是神模式,[ 键是人工模式; q 键是结束游戏,Q 键是退出并关闭游戏;

个人主页模板制作,你应该注意的SEO细节

…衆ロ難τιáo~ 提交于 2021-02-20 11:01:29
在个人主页制作的过程中,我们会遇到各种情况,针对不同的网站类型,以及实际需求,我们会给出不同的解决方案,特别是在个人主页模板设计的过程中,如果你掉以轻心,在后期SEO优化的过程中,往往是“积重难返”很不好调整。 那么,个人主页模板制作,你应该注意的SEO细节有哪些? 根据以往做沈阳SEO的经验,我们将通过如下内容,进一步阐述: 1、个人主页模板 在做个人主页制作的过程中,我们经常面对主要问题,包括: ①社区论坛的个人主页。 ②B2B与B2C电商网站的个人主页。 ③独立博客KOL的嘉宾页面。 当然,还有众多的个人页面模板类型,需要我们仔细研究,在这里就不一一赘述。 2、页面URL形态 在做个人主页制作的过程中,经常被忽略的一个SEO细节就是页面URL形态的问题,特别是基于社区论坛的链接,比如:大量的动态参数在其中。 这导致一个非常明显的问题,这种类型的页面,很难有效的被百度收录,而就无从谈排名。 3、页面内容展现 所谓的页面内容展现,主要是基于两个方面,一个是站内页面的展现,一个是搜索引擎SERP页面的展现,为此,我们可能需要: ①利用站内重要的栏目与页面,重复的展现个人主页,比如:专家聚合页。 ②合理的利用内链,展现个人主页的链接。 ③积极配置结构化数据,比如:熊掌ID,利用个人主页模板的图片调用,采用搜索结果出图。 4、页面权重流动 所谓的页面权重流动

Why do javascript functions need to have the keyword “async”? Isn't the “await” keyword enough? [closed]

て烟熏妆下的殇ゞ 提交于 2021-02-20 10:25:16
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Improve this question For instance, why does the function below need to have "async".. isn't using await specific enough for the compiler to parse the code without ambiguity? # Why do we need async here async function foo() { var user = await getUser(user_id); console.log

how to pass Authorization Bearer access token in websocket javascript client

醉酒当歌 提交于 2021-02-20 10:24:39
问题 My API Manager tool mandates that i should pass the Authorization Bearer access token with the websocket invocation call. They are providing samples of java code where they do that. The bearer token is set like ("Authorization", "Bearer e2238f3a-e43c-3f54-a05a-dd2e4bd4631f") .How can i do that in javascript? // HttpResponseDecoder to WebSocketHttpResponseDecoder in the pipeline. final WebSocketClientHandler handler = new WebSocketClientHandler( WebSocketClientHandshakerFactory .newHandshaker

Does a Javascript closure retain the entire parent lexical environment or only the subset of values the closure references? [duplicate]

别来无恙 提交于 2021-02-20 10:21:21
问题 This question already has answers here : About closure, LexicalEnvironment and GC (3 answers) Closed 1 year ago . Consider the following example: function makeFunction() { let x = 3; let s = "giant string, 100 MB in size"; return () => { console.log(x); }; } // Are both x and s held in memory here // or only x, because only x was referred to by the closure returned // from makeFunction? let made = makeFunction(); // Suppose there are no further usages of makeFunction after this point // Let's

devtools console: copy is not a function while on youtube

左心房为你撑大大i 提交于 2021-02-20 10:21:04
问题 I know that I can use copy() function on the console to add content to the clipboard. When I am on any other page copy('test') works. When I am on youtube I get: Uncaught TypeError: copy is not a function How can I fix this. E.g. Is there a way to prevent a site from overriding specific functions using devtools? Strangely on firefox copy() works on youtube, so could this be a chrome bug? 回答1: Run this in console: document.querySelector('#copy').remove(); Then use copy() as normal, e.g. copy

devtools console: copy is not a function while on youtube

こ雲淡風輕ζ 提交于 2021-02-20 10:20:40
问题 I know that I can use copy() function on the console to add content to the clipboard. When I am on any other page copy('test') works. When I am on youtube I get: Uncaught TypeError: copy is not a function How can I fix this. E.g. Is there a way to prevent a site from overriding specific functions using devtools? Strangely on firefox copy() works on youtube, so could this be a chrome bug? 回答1: Run this in console: document.querySelector('#copy').remove(); Then use copy() as normal, e.g. copy

Why do javascript functions need to have the keyword “async”? Isn't the “await” keyword enough? [closed]

夙愿已清 提交于 2021-02-20 10:19:19
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Improve this question For instance, why does the function below need to have "async".. isn't using await specific enough for the compiler to parse the code without ambiguity? # Why do we need async here async function foo() { var user = await getUser(user_id); console.log

Does a Javascript closure retain the entire parent lexical environment or only the subset of values the closure references? [duplicate]

北慕城南 提交于 2021-02-20 10:18:40
问题 This question already has answers here : About closure, LexicalEnvironment and GC (3 answers) Closed 1 year ago . Consider the following example: function makeFunction() { let x = 3; let s = "giant string, 100 MB in size"; return () => { console.log(x); }; } // Are both x and s held in memory here // or only x, because only x was referred to by the closure returned // from makeFunction? let made = makeFunction(); // Suppose there are no further usages of makeFunction after this point // Let's

how to pass Authorization Bearer access token in websocket javascript client

一曲冷凌霜 提交于 2021-02-20 10:17:45
问题 My API Manager tool mandates that i should pass the Authorization Bearer access token with the websocket invocation call. They are providing samples of java code where they do that. The bearer token is set like ("Authorization", "Bearer e2238f3a-e43c-3f54-a05a-dd2e4bd4631f") .How can i do that in javascript? // HttpResponseDecoder to WebSocketHttpResponseDecoder in the pipeline. final WebSocketClientHandler handler = new WebSocketClientHandler( WebSocketClientHandshakerFactory .newHandshaker