The user sets up the subscription and publication to take a postsLimit
Session variable as parameter.
The pagination helper takes care of changing the Session variable on click.
var oldCreate = Template.__create__; | |
Template.__create__ = function(viewName) { | |
var tmpl = oldCreate.apply(this, arguments); | |
var oldRender = tmpl.__render; | |
tmpl.__render = function() { | |
var className = viewName.replace('Template.', 'template-highlight '); | |
return HTML.SPAN({class: className}, oldRender.apply(this, arguments)); | |
} | |
return tmpl; |
Hello,
Many times, we see smaller sized droplets run out of memory due to the number of processes that are running. This can cause slow connections, services to crash and overall unpredictable behavior.
Potential solutions are:
Upsize to a larger server. We recommend at least a 1GB droplet for any server utilizing a MySQL database.
Enable swap (search for 'swap' in our articles https://digitalocean.com/community)
Template.onRendered(function () { | |
var node = this.firstNode; | |
if (node && node.nodeType !== 3) { // get rid of text nodes | |
$node = $(node); | |
var template = this.view.name; | |
$node.addClass('is-template').attr('data-template', template); | |
// avoid giving position:relative to absolute elements | |
if ($node.css('position') == 'static') { | |
$node.css('position', 'relative'); |
var capitaliseFirstLetter = function (string){ | |
return string.charAt(0).toUpperCase() + string.slice(1); | |
} | |
var buildTwitterLink = function (text, url) { | |
var encodedUrl = encodeURIComponent(url); | |
var referrer = encodeURIComponent("http://communitybuildingguide.com"); | |
// var url = "http%3A%2F%2Fbook.discovermeteor.com%2Fstarter%3Futm_source%3Dstarter%26utm_medium%3Dtwitter%26utm_campaign%3Dstarter_tweet"; | |
return "https://twitter.com/intent/tweet?original_referer="+referrer+"&url="+encodedUrl+"&text="+encodeURIComponent(text)+"&hashtags=combuild&via=telescopeapp"; | |
} |
Telescope has three tiers of packages.
These are third-party packages such as Iron Router, SimpleSchema, AutoForm, etc. that are used throughout the app. Inside telescope:lib
, they are used (api.use()
) and then implied (api.imply()
), which makes them available to any package that then use
s telescope:lib
.
Here's the full list:
api.use([
<template name="postsListController"> | |
{{> posts_list context}} | |
</template> |
Users.getDisplayName = function (user) { | |
console.log(user) | |
console.log(this) | |
return (user.telescope && user.telescope.displayName) ? user.telescope.displayName : Users.getUserName(user); | |
}; | |
Users.helpers({ | |
getDisplayName: function () { | |
return Users.getDisplayName(this); | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Screenings]]></title><description><![CDATA[The best design videos]]></description><link>http://apple.com/p</link><image><url>http://apple.com/pimg/favicon.png</url><title>Screenings</title><link>http://apple.com/p</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2015 01:55:41 GMT</lastBuildDate><atom:link href="http://apple.com/pfeed.xml" rel="self" type="application/rss+xml"/><imageUrl>http://www.bar.com/</imageUrl><item><title><![CDATA[How Designers Destroyed the World]]></title><description><![CDATA[You are directly responsible for what you put into the world. Yet every day designers all over the world work on projects without giving any thought or consideration to the impact that work has on the world around them. This needs to change.</br></br><a href="http |
Post = React.createClass({ | |
render() { | |
return ( | |
<div className="post"> | |
<h1>Hello World!</h1> | |
<p>Lorem ipsum</p> | |
</div> | |
) |