Skip to content

Instantly share code, notes, and snippets.

View mariorodriguespt's full-sized avatar
🏠
Working from home

Mário Rodrigues mariorodriguespt

🏠
Working from home
View GitHub Profile
const containerFunction = {
getMeteorData: ( props , context ) => {
console.log( 'context' , context );
...secret code...
return {
isReady ,
timelineEvents
};
export default function connect(options) {
let expandedOptions = options;
if ( typeof options === 'function' ) {
expandedOptions = {
getMeteorData: options ,
};
}
const { getMeteorData , pure = true , contextTypes = {} } = expandedOptions;
OrgMainNotification.propTypes = {};
export default createContainer(() => {
return {};
}, OrgMainNotification);
import React from 'react';
import { BrowserRouter, Route } from 'react-router-dom';
import createBrowserHistory from 'history/createBrowserHistory';
import Homepage from './pages/homepage/Homepage.jsx';
import Explore from './pages/explore/Explore.jsx';
import AboutUs from './pages/about-us/AboutUs';
const browserHistory = createBrowserHistory();
//Add this package meteor add matb33:collection-hooks
//Create a new file in /server/hooks.js
Meteor.startup(function(){
Thread.models.Contacts.model.after.update((userId, doc) => {
console.log('doc: ' , doc);
Meteor.users.update({
_id : doc.userId,
profile.userChangedName: false
},{
var debug = process.env.NODE_ENV !== 'production';
var webpack = require('webpack');
var HTMLWebpackPlugin = require('html-webpack-plugin');
var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});
Router.route('/messages', {
layoutTemplate : "app",
template : "messages"
name: 'my-messages’,
});
Meteor.startup(function(){
var toysCollection = Mongo.Collection.get('MeteorToysCredentials');
if( toysCollection.find().count() === 0 ) {
toysCollection.insert({
email : 'your@email.com',
password :'password'
});
}
[[[[[ ~/playground/meteor/rawCollection ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
=> Exited with code: 8
W20150522-01:45:48.227(1)? (STDERR)
W20150522-01:45:48.228(1)? (STDERR) /Users/mariorodrigues/.meteor/packages/mongo/.1.1.0.9ya52j++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/base.js:246
var funcs : [()->Int] = []
for i in 0...3{
funcs.append({
return i
})
}
for i in 0...3{
println(funcs[i]())