Skip to content

Instantly share code, notes, and snippets.

View michaelerobertsjr's full-sized avatar

Mike Roberts michaelerobertsjr

View GitHub Profile
@michaelerobertsjr
michaelerobertsjr / loopback.md
Last active March 9, 2017 23:09
Getting started with loopback

Getting Started with Loopback

  • install the generator
$ npm install -g strongloop
  • Scaffold out an app
$ slc loopback
@michaelerobertsjr
michaelerobertsjr / MongoQueries.md
Last active March 8, 2017 22:37
Mongo Queries

#MongoDB

What is mongo - document based database, no SQL How do you install it by default its not secure, you should add a user and restrict access before production

digital ocean mongo labs using mongoLabs mongo ds021671.mlab.com:21671/sdcs -u michael -p michael

@michaelerobertsjr
michaelerobertsjr / example.spec.js
Created March 7, 2017 23:19
An example of Chai spec file for an express app
const chai = require('chai');
const chaiHttp = require('chai-http');
const expect = chai.expect;
chai.use(chaiHttp);
const app = require('../server/app');
var mock = [];
describe("server module", function() {
@michaelerobertsjr
michaelerobertsjr / ESlint_and_Atom_Plugins.md
Last active February 12, 2017 19:03
ESLint and Atom Installation and setup instructions

ESLint

ESLint is an open source project originally created by Nicholas C. Zakas in June 2013. Its goal is to provide a pluggable linting utility for JavaScript. Adding it to all your projects and setting up a linter plugin in your code editor may help you write more maintainable code.

Installation

var fs = require('fs')
function readfile() {
new Promise(function (resolve, reject) {
fs.readFile('app/topspots.json', 'utf-8', function (err, file) {
if (err) {
console.log('Inside Error: ')
console.log(err);
return reject(err);
}
@michaelerobertsjr
michaelerobertsjr / 0_reuse_code.js
Created January 1, 2017 20:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@michaelerobertsjr
michaelerobertsjr / sendmail_setup.md
Created July 21, 2016 18:18 — forked from kany/sendmail_setup.md
Setup SENDMAIL on Mac OSX Yosemite
@michaelerobertsjr
michaelerobertsjr / dispatcher.js
Created November 16, 2015 23:23
Simple Flux Dispatcher
var guid = require('guid');
var listeners = {};
module.exports = {
register: function(cb) {
var id = guid.raw();
listeners[id] = callback;
return id;
},
dispatch: function(payload) {