Skip to content

Instantly share code, notes, and snippets.

View xavxyz's full-sized avatar
🎋
growing flex

Xavier Cazalot xavxyz

🎋
growing flex
View GitHub Profile
var communityName = Settings.get('title','Telescope'),
emailSubject = 'You are invited to try '+communityName,
route = user ? Telescope.utils.getSigninUrl() : Telescope.utils.getSignupUrl(), // this the line I added
emailProperties = {
newUser : typeof user === 'undefined',
communityName : communityName,
actionLink : Telescope.utils.getSiteUrl() + route, // site url + route depending if the user already have an account or not
invitedBy : Users.getDisplayName(currentUser),
profileUrl : Users.getProfileUrl(currentUser)
};
// Decouple updating the settings and adding the user to the mailchimplist in case of telescope settings autoSuscribe = true
// nova-newsletter/lib/callbacks.js
function updateUserNewsletterSettings (user, options) {
if (!!Telescope.settings.get('autoSubscribe') && !!user) {
user.telescope.newsletter_subscribeToNewsletter = true;
}
return user;
}
Telescope.callbacks.add("onCreateUser", updateUserNewsletterSettings);
import Posts from '../collection.js';
import moment from 'moment';
SyncedCron.options = {
log: true,
collectionName: 'cronHistory',
utc: false,
collectionTTL: 172800
};

This is a starter issue, highly inspired by the great job of the folks at Hoodie. 👍

🎃🙀👕🔭😻 Hacktoberfest: Trick or Treat!

If you haven’t yet, sign up for Hacktoberfest to earn an exclusive T-Shirt.

We are sure you can learn a cool trick or two in the process on how to hack & customize Telescope Nova! 🔭

🤔 What you will need to know

module.exports = {
servers: {
one: {
host: '1.2.3.4', // your server ip
username: 'root',
// pem: 'absolute/path/to/ssh/key',
// password:
// or leave blank for authenticate from ssh-agent
}
},
@xavxyz
xavxyz / nova-users-apollo-migration.js
Last active November 17, 2016 07:47
Migration script for Nova Users to run server-side: from user.telescope.settingX to user.__settingX (without removing user.telescope.settingX for backward compatibility)
// Explanation:
// This is a migration script for your users to be compatible with the Apollo version of Nova
// We do not support anymore users properties on the `telescope` namespace. They will be duplicated onto __setting:
// Example: `user.telescope.karma` becomes `user.__karma`
// Note: we do not remove the `user.telescope` object, you'll still be able to go back to your previous full Meteor build if you feel that Apollo doesn't fit your needs
// How to use:
// Copy/paste the script below at the end of the nova:users /packages/nova-users/lib/server.js (package's server entry-point)
Meteor.startup(function runMigrationToApollo() {
@xavxyz
xavxyz / update_trn.sh
Last active January 12, 2017 08:35
Stash, pull, apply, repeat
echo "// ------ 🔭 Updating Nova"
echo "// ------ Stashing your changes..."
git add .
git stash
# devel = Nova Apollo stable branch at the moment
git checkout devel
# origin = https://github.com/TelescopeJS/Telescope.git
git pull origin
echo "// ------ 🔭 Nova updated!"
echo "// ------ Applying your changes..."
@xavxyz
xavxyz / conditions-initiales.js
Last active January 13, 2017 05:31
Over-engineered experiment, yet interesting, on Nova forms and data loading with GraphQL
// custom field on Categories, querying a list of Categories
{
fieldName: 'attachedTeams',
fieldSchema: {
type: [String],
control: Components.CategoriesAttachedTeams,
optional: true,
insertableBy: ['admins'],
editableBy: ['admins'],
viewableBy: ['members'],

Atmosphere packages

Accounts

alanning:roles # easy-peasy permission stuff for your users

Validation

check # check arguments of a function manually
mdg:validation-method # meteor recommended way to use methods
// the scene takes place on Nova, NewsletterButton.jsx
// a little fancy way to do with promise and apollo mutation
subscriptionAction() {
this.props[this.props.mutationName]({userId: this.props.user._id}).then(result => {
this.props.successCallback(result);
}).catch(error => {
console.log(error); // eslint-disable-line no-console
this.props.flash(error.message, "error");