Code Monkey home page Code Monkey logo

cookbook's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookbook's Issues

Joins in Mongo

Here you say don't do joins in mongoDB, datalayer.md, but the mongo doc's say joins are necessary in cases where documents could be too large. Imagine a blog post with 1 million followers in an array, and all the comments, this would max out the 16MB document limit in Mongo.

See here:
http://docs.mongodb.org/manual/reference/database-references
In MongoDB some data is denormalized, or stored with related data in documents to remove the need for joins. However, in some cases it makes sense to store related information in separate documents, typically in different collections or databases.

This is why publish-with-relations package was written, and collections-helpers may come in useful too.

I'm struggling with this Stack Overflow question on adding a temporary field only on the client collection if a value exists in another doc:
http://stackoverflow.com/questions/20688718/meteor-one-to-many-relationship-and-add-field-to-only-to-client-side-collection

Unresolved Mongo symbol

Webstorm reports unresolved variable or symbol Mongo

Players = new Mongo.Collection("players");
              ^^^^^

Tabbed Workflow - Idea

With multiple-tabs it can get slow cause all templates get created immediately . What about the following?

html:

{{> DynamicTemplate template=getTemplate}}

js:

Template.Something.helpers({

  getTemplate: function () {

    if(Session.get('selectedPanel') === 1){
      return "firstPanel";
    };

    if(Session.get('selectedPanel') === 2){
      return "secondPanel";
    };
...

Tabbed Workflow - Incorrect Code

Hey Abigail,

I found few issues with the code. I think it should be

Template.samplePage.firstPanelVisibility = function(){
  if(Session.get('selectedPanel') === 1){
    return "visible";
  }else{
    return "hidden";
  }
}
Template.samplePage.secondPanelVisibility = function(){
  if(Session.get('selectedPanel') === 2){
    return "visible";
  }else{
    return "hidden";
  }
}
Template.samplePage.thirdPanelVisibility = function(){
  if(Session.get('selectedPanel') === 3){
    return "visible";
  }else{
    return "hidden";
  }
}
Template.samplePage.firstPanelActive = function(){
  if(Session.get('selectedPanel') === 1){
    return "active panel-tab";
  }else{
    return "panel-tab";
  }
}
Template.samplePage.secondPanelActive= function(){
  if(Session.get('selectedPanel') === 2){
    return "active panel-tab";
  }else{
    return "panel-tab";
  }
}
Template.samplePage.thirdPanelActive = function(){
  if(Session.get('selectedPanel') === 3){
    return "active panel-tab";
  }else{
    return "panel-tab";
  }
}

and the css should be like the following. This will still affect the flow of the document.

.visible{
  visibility: visible;
}
.hidden{
  visibility: hidden;
}

Better implementation might be

.show {
  display: block !important;
  visibility: visible !important;
}
.hidden {
  display: none !important;
  visibility: hidden !important;
}

Finish Monad / Functional Programming Article

I was reading the following in the ‘general-advice' chapter: “Creating class hierarchies is a good way to get frustrated with Meteor”. Which pretty much blew my mind: What else? Being still a pretty young programmer I’ve always assumed OO was a best practice by itself - admittedly probably a pretty naive assumption. The chapter mentions ‘monad decorator pattern’ could be used to simulate class inheritance. Fresh as I am I had never heard of monads before and - although I think I got some understanding of it - I found it hard to get a grasp on the concept. What remains a big mystery to me is how I would create monads that can have that hierarchical behaviour of class inheritance has without making use of actual classes and subclasses (or prototypes in JS’ case). Could anybody give some tips on how to approach this technique in meteor or maybe point out some literature on that subject?

First Production Deployment

I've used mup before to deploy to digital ocean but nothing special. I pretty much always just use meteor deploy because its so easy!

But now I'm looking to deploy a real production server that needs to handle some scale and I have no idea how to do this. Ive read a bunch of stuff in a bunch of different places but I haven't found a simple opinionated post giving an example.

I've read about oplog support so you can have multiple mongo servers. I've heard you can get mongohq to host your mongo server and they'll do this for you and create backups for you.

I've read about using AWS with collectionFS to host uploaded images, etc.

And I read through the very brief article on here about deploying the front end only to modulus.

To be honest, I just don't know how this all fits together. I would really appreciate it if you could write a bit more on this topic giving an example of a specific way of deploying a production server that is going to scale and how to tie everything together.

Thanks

Gitbook?

Hi,

Thx for the nice write up. It has teach me a couple of nice features and tricks.

I was wondering wether it would be possible that you add Gitbook?

PEM

Broken Link - Healthcare and Mobile Apps Presentation

Thanks again for coming down and presenting at the Philly Meetup! In the HIPAA Section, there is a typo / broken link:

# include an audit log
mrt add hippa-audit-log
git clone github.com/awatson1978/hippa-audit-log.git

I think this is what you want:

# include an audit log
mrt add hipaa-audit-log
git clone github.com/awatson1978/hipaa-audit-log.git

And thanks again for maintaing the Meteor Cookbook. Its a fantastic resource.

Avoid sudo mrt

As a general rule, package management like npm mixed with sudo is bad. This is especially true for something as young and fresh as meteorite.

I noticed a lot of sudo mrt ... in the cookbook, would be better to remove the sudo and just leave it as mrt ....

settings.json

How can you make a settings.json "setup" that uses values declared elsewhere? eg, consider the following.. in C, a sample.h file (psuedo-c)

define TITLE = "great success"

define MEDIA = "book"

define DOGS TITLE+" "+MEDIA+" "+" for dogs"

define CATS TITLE+" "+MEDIA+" "+" for cats"

define ELEPHANTS TITLE+" "+MEDIA+" "+" for elephants"

.. insert 1000 more animals here ...

The point is, I don't want to manage the same string in a JSON definition multiple times (in this case, TITLE and MEDIA) - I want to reuse it as a constant definition. But JSON is defined all at once, which (as far as I can tell?) makes this impossible in settings.json for Meteor.

So the following JSON is invalid, even though it represents the idea of what I want:
{
"TITLE" : "great success",
"MEDIA" : "book",
"animals" :
{
"DOGS" : TITLE+" "+MEDIA+" "+for dogs",
"CATS" : TITLE+" "+MEDIA+" "+for cats",
"ELEPHANTS" : TITLE+" "+MEDIA+" "+for elephants",
... 1000 more json definitions here ...
}
}

nightwatch doesnt seem to work

posix4e@posix4e-P27GV2:/projects/dutch3$ cd ..
posix4e@posix4e-P27GV2:
/projects$ meteor create dutch4
dutch4: created.

To run your new app:
cd dutch4
meteor
posix4e@posix4e-P27GV2:/projects$ cd dutch4
posix4e@posix4e-P27GV2:
/projects/dutch4$ ls
dutch4.css dutch4.html dutch4.js
posix4e@posix4e-P27GV2:~/projects/dutch4$ meteor add clinical:nightwatch

Changes to your project's package version selections:

clinical:nightwatch added, version 1.5.0

clinical:nightwatch: Ultra-easy acceptance testing with Selenium.
posix4e@posix4e-P27GV2:/projects/dutch4$
posix4e@posix4e-P27GV2:
/projects/dutch4$ ln -s .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/launch_nightwatch_from_app_root.sh run_nightwatch.sh
posix4e@posix4e-P27GV2:/projects/dutch4$ sudo chmod +x run_nightwatch.sh
chmod: cannot operate on dangling symlink ‘run_nightwatch.sh’
posix4e@posix4e-P27GV2:
/projects/dutch4$ ls
dutch4.css dutch4.html dutch4.js run_nightwatch.sh
posix4e@posix4e-P27GV2:/projects/dutch4$ unlink run_nightwatch.sh
posix4e@posix4e-P27GV2:
/projects/dutch4$ meteor
[[[[[ ~/projects/dutch4 ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/
^C
posix4e@posix4e-P27GV2:/projects/dutch4$ ln -s .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/launch_nightwatch_from_app_root.sh run_nightwatch.sh^C
posix4e@posix4e-P27GV2:
/projects/dutch4$ ls -lahyt
ls: invalid option -- 'y'
Try 'ls --help' for more information.
posix4e@posix4e-P27GV2:/projects/dutch4$ ls -laht
total 48K
drwxr-xr-x 3 posix4e posix4e 4.0K Dec 26 14:18 .
drwxr-xr-x 3 posix4e posix4e 4.0K Dec 26 14:17 .meteor
-rw-rw-r-- 1 posix4e posix4e 31 Dec 26 14:17 dutch4.css
-rw-rw-r-- 1 posix4e posix4e 219 Dec 26 14:17 dutch4.html
-rw-rw-r-- 1 posix4e posix4e 478 Dec 26 14:17 dutch4.js
drwxrwxr-x 20 posix4e posix4e 4.0K Dec 26 14:17 ..
posix4e@posix4e-P27GV2:
/projects/dutch4$ ln -s .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/launch_nightwatch_from_app_root.sh run_nightwatch.sh
posix4e@posix4e-P27GV2:/projects/dutch4$ ls -laht
total 52K
drwxr-xr-x 3 posix4e posix4e 4.0K Dec 26 14:18 .
lrwxrwxrwx 1 posix4e posix4e 106 Dec 26 14:18 run_nightwatch.sh -> .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/launch_nightwatch_from_app_root.sh
drwxr-xr-x 3 posix4e posix4e 4.0K Dec 26 14:17 .meteor
-rw-rw-r-- 1 posix4e posix4e 31 Dec 26 14:17 dutch4.css
-rw-rw-r-- 1 posix4e posix4e 219 Dec 26 14:17 dutch4.html
-rw-rw-r-- 1 posix4e posix4e 478 Dec 26 14:17 dutch4.js
drwxrwxr-x 20 posix4e posix4e 4.0K Dec 26 14:17 ..
posix4e@posix4e-P27GV2:
/projects/dutch4$ cd ..^C
posix4e@posix4e-P27GV2:/projects/dutch4$ sudo chmod +x run_nightwatch.sh
posix4e@posix4e-P27GV2:
/projects/dutch4$ sudo ./run_nightwatch.sh
changing file permissions
installing nightwatch in .meteor/local/build
sudo: npm: command not found
running nightwatch
sudo: .meteor/local/build/node_modules/nightwatch/bin/nightwatch: command not found
posix4e@posix4e-P27GV2:~/projects/dutch4$

Move to Gollum?

Be great to get this rebuilt as a gollum powered wiki with code samples in the repo instead of markdown. Just an idea... ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.