Skip to content

Instantly share code, notes, and snippets.

View michaelerobertsjr's full-sized avatar

Mike Roberts michaelerobertsjr

View GitHub Profile
@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) {
@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 / 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
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 / 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

@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 / 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 / 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 / example.cs
Created June 5, 2017 21:57 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@michaelerobertsjr
michaelerobertsjr / react.md
Last active June 30, 2017 03:40
Resources to learn React

Resources for Learning React

Course

Complete the React Basics course on Team Treehouse, or the equivelant on CodeSchool, PluralSight, etc.

Read

Read Thinking in React and quickly review the React docs.

Watch

Watch Thinking in React follow along carefully and if time permits build the project along side watching.