Skip to content

Instantly share code, notes, and snippets.

let repl = require('repl');
let models = require('./db/models');
Object.keys(models).forEach((modelName) => {
global[modelName] = models[modelName];
});
let replServer = repl.start({
prompt: 'app > ',
});
@jnormore
jnormore / bootstrap3-alert-box.js
Last active November 10, 2019 13:07
Bootstrap 3 alert and confirm modals. Overrides window.alert normally, but window.confirm override requires a callback function to be passed to get result. Optional arguments for modal title and confirm button label.
window.alert = function(message, title) {
if($("#bootstrap-alert-box-modal").length == 0) {
$("body").append('<div id="bootstrap-alert-box-modal" class="modal fade">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header" style="min-height:40px;">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\
<h4 class="modal-title"></h4>\
</div>\
<div class="modal-body"><p></p></div>\
@jnormore
jnormore / bootstrap-alert-modal.js
Last active December 27, 2015 18:58
Bootstrap 2.3 alert and confirm modals. Overrides window.alert normally, but window.confirm override requires a callback function to be passed to get result. Optional arguments for modal title and confirm button label.
window.alert = function(message, title) {
if($("#bootstrap-alert-box-modal").length == 0) {
$("body").append('<div id="bootstrap-alert-box-modal" class="modal hide fade">\
<div class="modal-header" style="min-height:20px;">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\
<h3></h3>\
</div>\
<div class="modal-body"><p></p></div>\
<div class="modal-footer">\
<a href="#" data-dismiss="modal" class="btn">Close</a>\