Skip to content

Instantly share code, notes, and snippets.

View onel0p3z's full-sized avatar
🏠
Working from home

Juan Lopez onel0p3z

🏠
Working from home
View GitHub Profile
@onel0p3z
onel0p3z / passport-user-credential.js
Created April 5, 2016 14:20 — forked from ernie58/passport-user-credential.js
Loopback Passport Component: keep UserIdentity in sync with UserCredentials
module.exports = function (PassportUserCredential) {
/*
* Check if credentials already exist for a given provider and external id
* Enable this hook if credentials can be linked only once
*
* @param Loopback context object
* @param next middleware function
* */
PassportUserCredential.observe('before save', function checkPassportUserCredentials(ctx, next){
@onel0p3z
onel0p3z / db.js
Created August 21, 2013 19:55 — forked from julianduque/db.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/app');
var usrSchema = new mongoose.Schema({
user: { type: String, required: true },
password: { type: String, required: true },
DLU: { type: Date }
});

Creating a remote Git repository

  • Ensure you can ssh user@targetserver successfully
    • Public/private keys are a smart choice here
  • On targetserver
    • Example here assumes all Git repository users are members of a gitusers group, adjust to suit
    • mkdir -p ~/path/to/repository
    • cd ~/path/to/repository
    • git init --bare --shared=group
  • Switch --shared=group will add core.sharedrepository = 1 to the repositories ~/path/to/repository/config file