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
// Require mongoose dependency | |
var mongoose = require('mongoose'); | |
var bcrypt = require('bcrypt-nodejs'); | |
var userSchema = new mongoose.Schema({ | |
email: { type: String, unique: true }, | |
password: String | |
}); | |
var User = mongoose.model('User', userSchema); |
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
(function(angular) { | |
"use strict"; | |
var app = angular.module('MyStore', ['ngCookies', 'ngMessages', 'ui.router']); | |
app.value('config', { | |
/* Create a merchant account and add the seller email below: | |
* https://www.paypal.com/webapps/mpp/merchant | |
*/ |
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
(function(angular) { | |
"use strict"; | |
var app = angular.module('MyStore'); | |
app.factory('CartService', function($cookieStore, ProductService) { | |
// Private items variable | |
var items = {}; |
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> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<label>Name:</label> |
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
<div class="col-md-3" ng-repeat="item in swag"> | |
<h4 ng-bind="item.title"></h4> | |
<div class="row"> | |
<div class="col-xs-4 col-md-6"> | |
<a href="#" class="thumbnail"> | |
<img ng-src="item.images[0]" alt="item.title"> | |
</a> | |
</div> | |
<p ng-bind="item.description"></p> | |
</div> |
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
// Require mongoose dependency | |
var mongoose = require('mongoose'); | |
// Create a swag schema | |
var swagSchema = mongoose.Schema({ | |
id: Number, | |
isFeatured: Boolean, | |
isActive: Boolean, | |
price: Number, | |
specialPrice: Number, |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
emptyCart: function() { | |
// Sets items object to an empty object | |
items = {}; | |
// Remove the items cookie | |
$cookieStore.remove('items'); | |
} |
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
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |