Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

View GitHub Profile
var co = require('co');
function getRandomArbitrary(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
co(function *(){
// yield any promise
//setTimeout(function(){
var result = yield Promise.resolve(true);
( 13)[Fri Sep 30 09:24:10| 1:000]{40}jhyland@jhmac:~/Documents/scripts/node/personal/sasset-core-beta(0) (master)$ node -v
v6.0.0
( 13)[Fri Sep 30 09:24:13| 0:000]{41}jhyland@jhmac:~/Documents/scripts/node/personal/sasset-core-beta(✓) (master)$ node src/app.js
/Users/jhyland/Documents/scripts/node/personal/sasset-core-beta/src/app.js:3
import * as _ from 'moar-lodash'
^^^^^^
SyntaxError: Unexpected token import
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:511:25)
at Object.Module._extensions..js (module.js:550:10)
( 13)[Fri Sep 30 09:29:01| 0:000]{50}jhyland@jhmac:~/Documents/scripts/node/personal/sasset-core-beta(0) (master)$ cat es6-test.js
#!/usr/local/bin/node
'use strict'
import _ from 'lodash'
_.forEach({ 'a': 1, 'b': 2 }, (value, key) => {
console.log(key)
})( 13)[Fri Sep 30 09:29:06| 0:000]{51}jhyland@jhmac:~/Documents/scripts/node/personal/sasset-core-beta(✓) (master)$ /usr/local/bin/node es6-test.js
/Users/jhyland/Documents/scripts/node/personal/sasset-core-beta/es6-test.js:4
/**
* Asset [Mongoose]{@link http://mongoosejs.com/} Model - Used to create/edit/delete any Asset documents, as well as MDB
* documents in the Field, Partition and Revision collections that may be associated to the the Asset(s)
*
* @module AssetModel
* @see {@link http://mongoosejs.com/docs/middleware.html|Mongoose Middleware}
* @see {@link http://mongoosejs.com/docs/guide.html|Mongoose Schema}
* @see {@link http://mongoosejs.com/docs/schematypes.html|Mongoose Schema Types}
*/
'use strict'
- Prior experience with Javascript development and Node.js
- Understand the importance of REST architecture and how it leverages API efficiency (EG: Differences between the HTTP request method verbs and HTTP response codes)
- Experience with ReactJS and Redux
- Experience designing and developing single-page web applications revolving around RESTful API’s
- Familiarity with OOP and common development design patterns
- Familiarity with common software development philosophies such as TDD (Test Driven Development), DRY (Dont Repeat Yourself) SoC (Separation of concerns), etc
- Experience writing unit tests (Specifically for ReactJS)
- Experience with JSDoc documentation format
- Experience with responsive web design & Twitter Bootstrap
- Familiarity with NPM, Webpack, Babel, SASS/LESS
var hunt = require('hunt'),
huntSequilize = require('hunt-sequilize'),
Hunt = hunt({
'sequelizeUrl': 'sqlite://localhost/' //create database in memory
});
huntSequilize(Hunt); //this it it
Hunt.extendModel('Planet', function (core) {
var Hunt = require('hunt'),
hrw = require('hunt-mongo-rest'),
hunt = Hunt({
'disableCsrf': true,
'huntKey': true,
'mongoUrl': 'mongodb://localhost/hrw_dev'
});
hunt.extendModel('Articles', function(core){
var ArticleSchema = new core.mongoose.Schema({
var Hunt = require('hunt'),
hrw = require('hunt-mongo-rest'),
hunt = Hunt({
'disableCsrf': true,
'huntKey': true,
'mongoUrl': 'mongodb://localhost/hrw_dev'
});
hunt.extendModel('Articles', function(core){
@jhyland87
jhyland87 / Asset.js
Created November 1, 2016 05:24
Example of a MongooseJS model with methods used to manage a single or multiple documents
module.exports = Mongoose => {
const Schema = Mongoose.Schema
const Types = Mongoose.Types
const AssetSchema = new Schema()
// INSTANCE METHODS ---------------------------------------------------
/**
afm (0.2.0)
atomic (1.1.14)
builder (3.2.2)
bundler (1.7.3, 1.3.5)
bundler-unload (1.0.2)
color (1.4.2)
columnize (0.3.6)
daemon_controller (1.1.5)
domain_name (0.5.13)
elif (0.1.0)