This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="plunker" xmlns:ng="http://angularjs.org" > | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.js"></script> | |
<script src="http://angular-ui.github.com/bootstrap/ui-bootstrap-tpls-0.1.0-SNAPSHOT.js"></script> | |
<script src="example.js"></script> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<!--[if lte IE 8]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="plunker" xmlns:ng="http://angularjs.org" > | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.js"></script> | |
<script src="http://angular-ui.github.com/bootstrap/ui-bootstrap-tpls-0.1.0-SNAPSHOT.js"></script> | |
<script src="example.js"></script> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<!--[if lte IE 8]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// credit: http://snipplr.com/view.php?codeview&id=56433 | |
// | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open("GET",'favicon.ico',false); | |
xmlhttp.overrideMimeType('text/plain; charset=x-user-defined'); | |
xmlhttp.send(); | |
var data = ''; | |
for ( var i = 0; i < xmlhttp.responseText.length; i++ ) data += String.fromCharCode( ( xmlhttp.responseText[ i ].charCodeAt(0) & 0xff ) ); | |
// Convert raw data to base64 | |
data = btoa( data ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chai = require 'chai' | |
chai.should() | |
PouchDB = require 'pouchdb' | |
describe "myPouch", -> | |
db = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////// | |
linting errors: | |
////////////////// | |
/Users/frankg/dev/code/seeds/mobx-starter-2016/app/components/App.js | |
1:1 error Definition for rule 'no-duplicate-imports' was not found no-duplicate-imports | |
1:1 error Definition for rule 'no-unsafe-finally' was not found no-unsafe-finally | |
1:1 error Definition for rule 'no-useless-computed-key' was not found no-useless-computed-key | |
1:1 error Definition for rule 'no-useless-escape' was not found no-useless-escape | |
/Users/frankg/dev/code/seeds/mobx-starter-2016/app/components/Blocks.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
module.exports = function(app) { | |
//data sources | |
var dsMongoDB = app.dataSources.dsMongoDB; | |
//create all models | |
async.parallel({ | |
reviewers: async.apply(createReviewers), | |
coffeeShops: async.apply(createCoffeeShops), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(Review) { | |
Review.beforeRemote('create', function(context, user, next) { | |
context.args.data.date = Date.now(); | |
context.args.data.publisherId = context.req.accessToken.userId; | |
next(); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loopback-getting-started abbreviated process | |
// install loopback | |
npm install -g strongloop | |
// generate app | |
slc loopback CoffeeShops | |
? What's the name of your application? CoffeeShops | |
? Enter name of the directory to contain the project: CoffeeShops |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(app) { | |
app.dataSources.dsMongoDB.automigrate('CoffeeShop', function(err) { | |
if (err) throw err; | |
app.models.CoffeeShop.create([ | |
{name: 'Bel Cafe', city: 'Vancouver'}, | |
{name: 'Three Bees Coffee House', city: 'San Mateo'}, | |
{name: 'Caffe Artigiano', city: 'Vancouver'}, | |
], function(err, coffeeShops) { | |
if (err) throw err; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loopback-getting-started-intermediate process | |
// goto project directory | |
cd CoffeeShops | |
// generate model (table) | |
slc loopback:model // prompts... | |
Model name: Review | |
Data source: mongoDs (mongodb) |