TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.
| // Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
| // See also: http://www.paulund.co.uk/change-url-of-git-repository | |
| $ cd $HOME/Code/repo-directory | |
| $ git remote rename origin bitbucket | |
| $ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
| $ git push origin master | |
| $ git remote rm bitbucket |
| (function () { | |
| var makeCallback = function(eventType, observer) { | |
| if (eventType === 'value') { | |
| return function(snap) { | |
| observer.onNext(snap); | |
| }; | |
| } else { | |
| return function(snap, prevName) { | |
| // Wrap into an object, since we can only pass one argument through. | |
| observer.onNext({snapshot: snap, prevName: prevName}); |
Magic words:
psql -U postgresSome 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)| (function () { | |
| var makeCallback = function(eventType, observer) { | |
| if (eventType === 'value') { | |
| return function(snap) { | |
| observer.onNext(snap); | |
| }; | |
| } else { | |
| return function(snap, prevName) { | |
| // Wrap into an object, since we can only pass one argument through. | |
| observer.onNext({snapshot: snap, prevName: prevName}); |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| var mongoose = require('mongoose'); | |
| var repository = function (modelName) { | |
| var self = this; | |
| self.Model = require('../models/' + modelName); | |
| self.FindById = function (id, cb) { | |
| self.FindOne({ |