Skip to content

Instantly share code, notes, and snippets.

View gocreating's full-sized avatar

翁治平 gocreating

  • Taiwan
View GitHub Profile
@gocreating
gocreating / gist:b391b81e65698b7223ce78a1cb9f3cd1
Created October 23, 2016 16:04 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
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
@gocreating
gocreating / my-model.js
Created September 20, 2018 05:53 — forked from pulkitsinghal/my-model.js
Non-Static (instance) remote methods for loopback
var loopback = require('loopback');
// HINT(s):
// Getting the app object: http://docs.strongloop.com/display/public/LB/Working+with+LoopBack+objects
// From a model script: http://docs.strongloop.com/display/public/LB/Working+with+LoopBack+objects#WorkingwithLoopBackobjects-Fromamodelscript
module.exports = function(StoreModel) {
StoreModel.prototype.instanceRemoteMethodSignature = function(cb) {
console.log('print this instance object: ', this);
cb(null);
};