Today I Learned

7 posts by marekpolakowski

Group console logs

There’s this cool feature in JS console (works in Chrome and Firefox) you can use if you want to log a lot of information, but you’re afraid of JS console getting too crowded. See example:

Code example

console.groupCollapsed("types of components");
console.log(typeof ComponentOne);
console.log(typeof ComponentTwo);
console.log(typeof ComponentThree);
console.groupEnd();

That’s what you’ll get in JS console

image

Using multiple commands on heroku CLI

Need to use multiple heroku CLI commands one after another and don’t want to type -a foo-bar-baz every time?

Type export HEROKU_APP=foo-bar-baz in terminal and then just happily run heroku command on foo-bar-baz application.

heroku pg:backups:capture -a foo-bar-baz

# is equivalent to:

export HEROKU_APP=foo-bar-baz
heroku pg:backups:capture

PS. After that you might want to unset HEROKU_APP to remove variable.