Facebook tutorials and resources:
- Introducing Relay and GraphQL, Data fetching for React applications @Facebook.
- GraphQL Introduction @Facebook
- Building the facebook news feed with relay
Why be interested:
const express = require('express') | |
const next = require('next') | |
const dev = process.env.NODE_ENV !== 'production' | |
const app = next({ dev }) | |
const handle = app.getRequestHandler() | |
app.prepare() | |
.then(() => { | |
const server = express() |
Facebook tutorials and resources:
Why be interested:
# add the email package | |
meteor add email |
The prep-script.sh
will setup the latest Node and install the latest perf version on your Linux box.
When you want to generate the flame graph, run the following (folder locations taken from install script):
sudo sysctl kernel/kptr_restrict=0
perf record -i -g -e cycles:u -- ~/sources/node/node --perf-basic-prof script.js
perf script | egrep -v "( __libc_start| LazyCompile | v8::internal::| Builtin:| Stub:| LoadIC:|\[unknown\]| LoadPolymorphicIC:)" | sed 's/ LazyCompile:[*~]\?/ /' | ~/sources/FlameGraph/stackcollapse-perf.pl > out.perf-folded
<head> | |
<title>abc</title> | |
</head> | |
<body> | |
{{#sourceCode}} | |
<template name="books"> | |
<input type="text" placeholder="Search..." value="{{booksSearchQuery}}"> | |
{{#if searchResults.count}} |
Meteor.methods({ | |
searchPosts: function(term) { | |
console.log('-- searching for "'+term+'" --') | |
Future = Npm.require('fibers/future'); | |
var fut = new Future(); | |
Meteor._RemoteCollectionDriver.mongo.db.executeDbCommand({ | |
"text": "posts", | |
search: term | |
}, function (error,results){ |
var http = require('http'); | |
var sys = require('sys'); | |
function request() | |
{ | |
var host = 'google.com'; | |
var client = http.createClient(443, host, true); | |
var request = client.request('GET', '/', | |
{'host': host}); | |
request.end(); |