This file contains hidden or 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
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
This file contains hidden or 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
| //CORS middleware | |
| var allowCrossDomain = function(req, res, next) { | |
| res.header('Access-Control-Allow-Origin', config.allowedDomains); | |
| res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
| res.header('Access-Control-Allow-Headers', 'Content-Type'); | |
| next(); | |
| } | |
| //... |
This file contains hidden or 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
| CREATE TABLE [dbo].[UserProfile] ( | |
| [UserId] INT IDENTITY (1, 1) NOT NULL, | |
| [UserName] NVARCHAR (MAX) NULL, | |
| PRIMARY KEY CLUSTERED ([UserId] ASC) | |
| ); | |
| CREATE TABLE [dbo].[webpages_Membership] ( | |
| [UserId] INT NOT NULL, | |
| [CreateDate] DATETIME NULL, | |
| [ConfirmationToken] NVARCHAR (128) NULL, |
This file contains hidden or 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 mongoose = require("mongoose"), | |
| UserSchema = require('../models/User').Schema; | |
| WebsiteSchema = require('../models/Website').Schema; | |
| Website = require('../models/Website').Model; | |
| module.exports = { | |
| // get > api/website | |
| get: function (req, res, next) { | |
| return Website.find(function (err, websites) { | |
| if (!err) { |
This file contains hidden or 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
| app.get('/api/website', routes.api.website.get); | |
| app.get('/api/website/:id', routes.api.website.getById); | |
| app.post('/api/website', routes.api.website.create); | |
| app.put('/api/website/:id', routes.api.website.update); | |
| app.delete('/api/website/:id', routes.api.website.delete); |
This file contains hidden or 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
| git config --global mergetool.sublime.cmd "subl -w \$MERGED" | |
| git config --global mergetool.sublime.trustExitCode false | |
| git config --global merge.tool sublime | |
| git mergetool -y |
This file contains hidden or 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
| rmdir /s /q dirname |
This file contains hidden or 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
| .css-form input.ng-valid.ng-dirty { | |
| background-color: #cbffcb; | |
| } | |
| .css-form input.ng-invalid.ng-dirty { | |
| background-color: #ffcbcb; | |
| } |
This file contains hidden or 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
| $(document).ready(function () { | |
| $('ul.nav > li > a[href="' + document.location.pathname + '"]').parent().addClass('active'); | |
| }); |
This file contains hidden or 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 UserSchema = new Schema({ | |
| username: { type: String, required: true, trim: true, unique: true }, | |
| password: { type: String, required: true }, | |
| email: { type: String, lowercase: true, trim: true, unique: true }, | |
| salt: { type: String, required: true }, | |
| hash: { type: String, required: true }, | |
| verificationToken: { type: String }, | |
| verificationTokenExpirationDate: { type: Date }, | |
| isConfirmed: { type: Boolean, default: false }, |
OlderNewer