Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.
$ npm install mongoose --save
const mongoose = require('mongoose');
| var express = require('express'); | |
| var app = express.createServer(); | |
| require('./settings').boot(app); | |
| app.dynamicHelpers({ | |
| base: function(){ | |
| // return the app's mount-point | |
| // so that urls can adjust. For example | |
| // if you run this example /post/add works |
| var application_root = __dirname, | |
| express = require("express"), | |
| path = require("path"), | |
| mongoose = require('mongoose'); | |
| var app = express.createServer(); | |
| // database | |
| mongoose.connect('mongodb://localhost/ecomm_database'); |
| // | |
| // CRUD API for RESTful services with URLs similar 'http://services.mysite.com/classes/Book'. | |
| // | |
| // e.g. parse.get( | |
| // "Book", | |
| // 123, | |
| // function(response){ console.log(response.toString());} | |
| // ); | |
| // | |
| services.factory('parse', function($rootScope, $http) { |
| { | |
| "bold_folder_labels": true, | |
| "color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", | |
| "default_line_ending": "unix", | |
| "fade_fold_buttons": false, | |
| "fallback_encoding": "Shift_JIS", | |
| "font_options": "subpixel_antialias", | |
| "font_size": 10, | |
| "format_on_save": true, | |
| "gutter": true, |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| # NewFileAtCurrentFolder | |
| import sublime_plugin | |
| import os.path | |
| class NewFileListener(sublime_plugin.EventListener): | |
| def on_new_async(self, view): | |
| if not view.window().active_view(): | |
| print("NF: no view") | |
| return |
Visit my blog or connect with me on Twitter
git init
or
Press minus + shift + s and return to chop/fold long lines!