Skip to content

Instantly share code, notes, and snippets.

View bnielsen1965's full-sized avatar
🎯
Focusing

Bryan Nielsen bnielsen1965

🎯
Focusing
View GitHub Profile
@bnielsen1965
bnielsen1965 / Product.js
Created April 27, 2019 03:22
Adding a sub-schema to use in place of a Mixed type...
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const schemaOptions = {
timestamps: true
};
// this defines a sub-schema that will be used inside the Product schema...
const variantSchema = new Schema({
parent child
request lock on mutex :loop
create child thread request lock on mutex (may be a timeout)
:loop
poll for button change
release lock on mutex
wait on barrier release lock on mutex (if not timeout)
wait on barrier (if not timeout)
@bnielsen1965
bnielsen1965 / changelog.sh
Last active January 29, 2018 18:16
bash script to generate change logs from git folder with tagged versions.
#!/usr/bin/env bash
#
# git change log generator
# https://gist.github.com/bnielsen1965
#
# THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
# EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
# PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@bnielsen1965
bnielsen1965 / fedora-install-nodejs.sh
Created April 28, 2017 19:37 — forked from trajakovic/fedora-install-nodejs.sh
Install node.js on fedora (23+).(v5.10.1)
#!/usr/bin/env bash
#
# NodeJS Installer based on https://gist.github.com/trajakovic/ad9f91776dea3b495db0
#
# Added version option and distinct commands for install, uninstall, path setting,
# and removepath setting.
#
# https://gist.github.com/bnielsen1965
#
# THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@bnielsen1965
bnielsen1965 / extend.js
Created November 3, 2016 21:48
Javascript extend / merge for objects.
/**
* Extend an objects properties by merging with additional object arguments.
* The source objects should be in a comma separated list after the target
* parameter.
* @param {object} target - The target object for the merge.
* @return {object} The final object from target merged with additional objects in the argument list.
*/
self._extend = function _extend(target) {
var sources = [].slice.call(arguments, 1);
@bnielsen1965
bnielsen1965 / sshmount.sh
Created September 1, 2014 19:35
BASH script used to simplify the mounting and unmounting of remote file shares over ssh using sshfs. I use this with the options "allow_other,default_permissions,idmap=user" to work with perforce on linux.
#!/bin/bash
# default settings
MOUNT_OPTIONS=
MOUNT_POINT=
MOUNT_PATH=
MOUNT_USER=
MOUNT_PASSWORD=
MOUNT_HOST=
MOUNT_COMMAND=mount