diff --git a/css/prism.css b/css/prism.css new file mode 100644 index 000000000..1e544d64e --- /dev/null +++ b/css/prism.css @@ -0,0 +1,114 @@ +/** + * okaidia theme for JavaScript, CSS and HTML + * Loosely based on Monokai textmate theme by http://www.monokai.nl/ + * @author ocodia + */ + +code[class*="language-"], +pre[class*="language-"] { + color: #f8f8f2; + text-shadow: 0 1px rgba(0,0,0,0.3); + font-family: Consolas, Monaco, 'Andale Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; + border-radius: 0.3em; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #272822; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #f8f8f2; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.constant, +.token.symbol { + color: #f92672; +} + +.token.boolean, +.token.number{ + color: #ae81ff; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.builtin { + color: #a6e22e; +} + + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable { + color: #f8f8f2; +} + +.token.atrule, +.token.attr-value +{ + color: #e6db74; +} + + +.token.keyword{ +color: #66d9ef; +} + +.token.regex, +.token.important { + color: #fd971f; +} + +.token.important { + font-weight: bold; +} + +.token.entity { + cursor: help; +} + diff --git a/css/styles.css b/css/styles.css index 40c74a59c..5541c3349 100755 --- a/css/styles.css +++ b/css/styles.css @@ -149,7 +149,7 @@ pre { position: relative; text-transform: uppercase; font-weight: bold; - font-size: 26px; + font-size: 34px; } .fancy span:before, .fancy span:after { @@ -274,14 +274,16 @@ pre { /* START: SECTIONS*/ #examples .article h3, #gs .article h3, #about .article h3 { - margin-top: 0px; + margin-top: 30px; margin-bottom: 15px; font-weight: 700; + font-size: 32px; } #examples .article p, #gs .article p, #about .article p { margin-bottom: 20px; text-align: left; + font-size: 22px; } h3 .item { @@ -289,8 +291,12 @@ h3 .item { } #examples .article li, #gs .article li, #about .article li { text-align: left; + font-size: 22px; + margin-bottom: 10px; } +pre {font-size: 16px;} + /* END: SECTIONS */ /* START: CONTACT SECTION (NOT CURRENTLY IN DOCUMENT) */ diff --git a/examples.html b/examples.html deleted file mode 100644 index a75396e63..000000000 --- a/examples.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -
-Assuming you have already installed Node...
$ slc install -g strong-cli+
$ npm install -g strong-cli
$ slc lb project my-app+
$ slc lb project my-app
-$ slc lb model bank ++$ slc lb model bank $ slc lb model account $ slc lb model transaction -
-$ slc lb acl --all-models --deny --everyone ++$ slc lb acl --all-models --deny --everyone $ slc lb acl --allow --everyone --read --model bank $ slc lb acl --allow --everyone --call create --model user $ slc lb acl --allow --owner --all --model user $ slc lb acl --allow --owner --read --model account $ slc lb acl --allow --owner --write --model account -
The following are from the Banking App
+The following are from the banking example app
-$ slc lb project my-bank-app +++$ slc lb project my-bank-app $ cd my-bank-app $ slc lb model bank $ slc lb model account $ slc lb model transaction -
-$ slc lb acl --all-models --deny --everyone ++$ slc lb acl --all-models --deny --everyone $ slc lb acl --allow --everyone --read --model bank $ slc lb acl --allow --everyone --call create --model user $ slc lb acl --allow --owner --all --model user $ slc lb acl --allow --owner --read --model account $ slc lb acl --allow --owner --write --model account -
-MyProduct = loopback.Model.extend('my-product');
+MyProduct = loopback.Model.extend('my-product');
app.model(MyProduct);
MyProduct.create({
- name: 'Pencil',
- price: 0.99
+ name: 'Pencil',
+ price: 0.99
});
-
+
-MyProduct.find({
- where: {price: {lt: 100}},
- order: 'price ASC',
- limit: 3
+MyProduct.find({
+ where: {price: {lt: 100}},
+ order: 'price ASC',
+ limit: 3
}, function(err, products) {
...
});
-
+
+
-var Model = require('loopback').Model;
+var Model = require('loopback').Model;
var Product = Model.extend('product');
var Inventory = Model.extend('customer');
+
// Attach data sources
var db = loopback.createDataSource({
- connector: require('loopback-connector-mongodb')
+ connector: require('loopback-connector-mongodb')
});
+
// Enable the model to use the MongoDB API
Product.attachTo(db);
+
// Create a new product in the database
Product.create({ name: 'widget', price: 99.99 },
- function(err, widget) {
- // The product's id, added by MongoDB
- console.log(widget.id);
+ function(err, widget) {
+ console.log(widget.id); // The product's id, added by MongoDB
});
-
+
-var loopback = require('loopback');
+var loopback = require('loopback');
var ds = loopback.createDataSource('oracle', {
- "host": "demo.strongloop.com",
- "port": 1521,
- "database": "XE",
- "username": "demo",
- "password": "L00pBack"
- });
-
+ "host": "demo.strongloop.com",
+ "port": 1521,
+ "database": "XE",
+ "username": "demo",
+ "password": "L00pBack"
+});
+
-var ds = require('../data-sources/db.js')('oracle');
+var ds = require('../data-sources/db.js')('oracle');
// Discover and build models from INVENTORY table
ds.discoverAndBuildModels('INVENTORY',
- {visited: {}, owner: 'LOOPBACK', associations: true},
- function (err, models) {
- models.Inventory.findOne({}, function (err, inv) {
- if (err) {
- console.error(err);
- return;
- }
- console.log("\nInventory: ", inv);
- inv.product(function (err, prod) {
- console.log(err);
- console.log("\nProduct: ", prod);
- console.log("\n ------------- ");
- });
- });
-
-
-
+ {visited: {}, owner: 'LOOPBACK', associations: true},
+ function (err, models) {
+ models.Inventory.findOne({}, function (err, inv) {
+ if (err) {
+ console.error(err);
+ return;
+ }
+ console.log("\nInventory: ", inv);
+ inv.product(function (err, prod) {
+ console.log(err);
+ console.log("\nProduct: ", prod);
+ console.log("\n ------------- ");
+ });
+ });
+ }
+)
+