Skip to content

Instantly share code, notes, and snippets.

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

Simon Neufville xerosai

🏠
Working from home
View GitHub Profile
@mnem
mnem / git_fetch_pull_all_subfolders.sh
Created December 6, 2011 14:35
Simple bash script for fetching and pulling all repos in the executed folder to the latest of the branch they are on
#!/bin/bash
################
# Uncomment if you want the script to always use the scripts
# directory as the folder to look through
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPOSITORIES=`pwd`
IFS=$'\n'
@styopdev
styopdev / pick-schema.js
Last active February 15, 2022 22:59
Get mongoose schema fields, excluding specified values, for lodash.
_.mixin({ pickSchema: function (model, excluded) {
var fields = [];
model.schema.eachPath(function (path) {
_.isArray(excluded) ? excluded.indexOf(path) < 0 ? fields.push(path) : false : path === excluded ? false : fields.push(path);
});
return fields;
}
});
// Example