Relay | Apollo | |
---|---|---|
Built by | Facebook (Check out the project on GitHub) | Meteor (Check out the project on GitHub) |
Frontend Technologies | Requires React / React Native and configuration of Babel plugin | Framework and platform agnostic (works with any JS framework such as React, Angular or Vue as well as on the native mobile platforms) |
GraphQL API | Requires a certain structure in the GraphQL schema | Works with any GraphQL schema |
Complexity | Slow learning curve: Lots of powerful magic happening behind the scenes | Low entrance barrier: Let's you get started quickly and involves more manual work for certain features |
Flexibility | Almost no flexibility, strict rules how to |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
'use strict'; | |
var db = require('mongoose').connection; | |
var credential = require('credential'); | |
var User = require('./models/user'); // the mongoose model | |
exports.createUser = function createUser(userAttrs, callback) { | |
db.once('open', function () { | |
User.findOne({ username: userAttrs.username }, 'username', function (err, person) { | |
if (err) return callback(err); | |
if (person) { |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
gulp.task('browserify', function() { | |
return browserify('./js/app.js') | |
.transform(babelify, { stage: 0 }) | |
.bundle() | |
.on('error', function(e){ |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
<?php | |
// ... | |
public function testProtected() | |
{ | |
$dateFormatter = new DateFormatter; | |
$class = new \ReflectionClass('DateFormatter'); |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
- Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)