meteor

$(window).scroll(…) is running even if the template is destroyed in meteor

怎甘沉沦 提交于 2020-05-16 06:06:25
问题 I have two separate template and in both template(rendered) i am doing $(window).scroll() but however go to one template another, the $(window).scroll() is running from both, previous as well as current template. Code Snippets as below: dashboard1.js Template.dashboard1.rendered = function(){ $(window).scroll(function() { console.log('dashboard1 scroll'); //... doing pagination and sticky element for dashboard1 }); } Template.dashboard1.destroyed = function(){ console.log('dashboard1

你知道什么是 GitHub Action 么?

允我心安 提交于 2020-04-26 18:26:56
本文是 GitHub Action 的入门教程,如您已有相关使用经验可以直接关掉。 GitHub Action 是 GitHub 于 2018 年 10 月推出的一个 CI\CD 服务。 之前一直都是 Beta 版本,正式版于 2019 年 11 月正式推出。 首先还是先放几个官方的链接: GitHub Action : https://github.com/features/actions GitHub Action 官方市场: https://github.com/marketplace?type=actions CI\CD CI\CD 其实说的是三件事情:「持续集成(Continuous Integration)」、「持续交付(Continuous Delivery)」、「持续部署(Continuous Deployment)」。 因为「持续交付」和「持续部署」的英文缩写是一样的,所以这三件事情缩写成了 CI\CD 。 持续集成 那么什么是「持续集成」?借用一幅图: 从这幅图上可以很清楚的看到「持续集成」的流程: 开发人员提交代码到 Source Repository (源代码仓库),并通过 git hook 等 触发 CI Server(持续集成服务器)的相关功能。执行 编译 -> 测试 -> 输出结果 的流程 向开发人员反馈结果的 report

@hdu - 6584@ Meteor

偶尔善良 提交于 2020-03-06 00:48:17
目录 @description@ @solution@ @accepted code@ @details@ @description@ 询问第 k 小的分子分母 ≤ n 的既约分数。 Input 第一行包含一个整数 T(T≤10^2),表示数据组数。 接下来 T 行每行两个整数 n, k,表示一组询问。保证询问的答案在 (0,1] 范围内。 Output 输出 T 行,每行包含一个分数 p/q,要求 gcd(p, q) = 1。 Sample Input 5 4 6 5 1 9 9 3 4 7 11 Sample Output 1/1 1/5 1/3 1/1 3/5 Hint 杭电支持 __int128。 @solution@ 寻找第 k 小,不难想到使用二分法。 则假如二分到一个值 x,≤ x 的既约分数可以用如下式子计算: \[ans = \sum_{i=1}^{n}\sum_{j=1}^{\lfloor x*i\rfloor}[gcd(i, j) = 1]\] 对其进行反演可得: \[ans = \sum_{i=1}^{n}\sum_{d=1}^{d|i}\mu(d)*\lfloor\frac{x*i}{d}\rfloor \\ = \sum_{a*b\le n}\mu(a)*\lfloor x*b \rfloor \\ = \sum_{i=1}^{n}\mu(i)*\sum

Draft js saving and rendering or displaying content

拈花ヽ惹草 提交于 2020-02-27 08:55:11
问题 The question is: How do I save draft-js content as html and later render the content (which is a html string at this point) on the page. Thought I'd share what I've learnt. Please find in the solution one approach to saving and rendering content using draft.js. Also please post your own solutions so that we can all learn. 回答1: after endless searching and scouring the internet for how to use draft.js for a blog we are building, i thought I would share what I learnt. Draft.js is AMAZING but its

Draft js saving and rendering or displaying content

六月ゝ 毕业季﹏ 提交于 2020-02-27 08:54:13
问题 The question is: How do I save draft-js content as html and later render the content (which is a html string at this point) on the page. Thought I'd share what I've learnt. Please find in the solution one approach to saving and rendering content using draft.js. Also please post your own solutions so that we can all learn. 回答1: after endless searching and scouring the internet for how to use draft.js for a blog we are building, i thought I would share what I learnt. Draft.js is AMAZING but its

Can Meteor correctly handle data updated externally directly to the MongoDB database?

冷暖自知 提交于 2020-02-25 07:00:18
问题 Context: I already have a Nodejs server app that takes care of reading and writing to a MongoDB database autonomously. This service doesn't have any public endpoint, so the only way to communicate with it is through the database itself. Now I want to build an independent web application, a website that will consume the data available at the previously mentioned MongoDB database. Most of this data should be shown in real-time to the user. After some framework research, I'm considering to use

Mongorestore “auth fails” at deployed app at meteor.com

此生再无相见时 提交于 2020-02-24 12:31:19
问题 I received the information from my deployed app by using the command meteor mongo -url bhedir.meteor.com I then took the response and used the info for my mongorestore -u client -p meteorinfo - h meteorinfo -d bhedir_meteor_com meteordump/meteor however, I keep getting the following error: assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" } I should note that I have several meteorite packages included but I don't see how that would affect this. Also, I've done this before, granted not

Meteor 1.0 - Passing a parameter into pathFor using iron:router

偶尔善良 提交于 2020-02-23 07:36:32
问题 I've seen a few answers on how to pass a parameter using iron:router as the third parameter, for example: href="{{pathFor 'article' _id=this._id }}" What I would like to do is pass a parameter as the second variable (where 'article' is in the example above). I have a collection of posts that contain a title , a body , and a type . There are three types of articles in the project I'm working on, and each type needs to be routed to a different template because the formatting is significantly

Meteor 1.0 - Passing a parameter into pathFor using iron:router

自古美人都是妖i 提交于 2020-02-23 07:36:08
问题 I've seen a few answers on how to pass a parameter using iron:router as the third parameter, for example: href="{{pathFor 'article' _id=this._id }}" What I would like to do is pass a parameter as the second variable (where 'article' is in the example above). I have a collection of posts that contain a title , a body , and a type . There are three types of articles in the project I'm working on, and each type needs to be routed to a different template because the formatting is significantly

Tokbox failed to create session

拟墨画扇 提交于 2020-02-23 06:39:47
问题 [Error: Failed to createSession. Error: An authentication error occurred: (403) {"code":-1,"message":"Expired token"}] I was able to create a session just fine on my localhost server, but when I put it in production - which has https - the error occurs. I am using tokbox with Meteor framework and wraping the function inside a method: const opentok = new OpenTok(Meteor.settings.public.opentok.apiKey, Meteor.settings.public.opentok.apiSecret); let createSessionSync = Meteor.wrapAsync(opentok