Skip to content

Instantly share code, notes, and snippets.

View aaronroberson's full-sized avatar

Aaron Roberson aaronroberson

View GitHub Profile
@aaronroberson
aaronroberson / User.js
Last active August 29, 2015 14:02
Geekwise Day 10 Assets
// 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);
@aaronroberson
aaronroberson / app.js
Created June 19, 2014 03:38
Geekwise Day 12 Assets
(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
*/
@aaronroberson
aaronroberson / cart-service.js
Last active August 29, 2015 14:02
Geekwise Day 11 Assets
(function(angular) {
"use strict";
var app = angular.module('MyStore');
app.factory('CartService', function($cookieStore, ProductService) {
// Private items variable
var items = {};
@aaronroberson
aaronroberson / data-binding
Last active August 29, 2015 14:03
Geekwise2 Day 2
<!doctype html>
<html ng-app>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>
<label>Name:</label>
@aaronroberson
aaronroberson / swag.html
Last active August 29, 2015 14:03
Geekwise2 Day 3
<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>
@aaronroberson
aaronroberson / Swag.js
Last active August 29, 2015 14:03
Geekwise2 Day 5
// 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,
@aaronroberson
aaronroberson / 0_reuse_code.js
Created July 9, 2014 03:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aaronroberson
aaronroberson / emptyCart
Last active August 29, 2015 14:04
Geekwise2 Day 8 - Shopping Cart Part 2
emptyCart: function() {
// Sets items object to an empty object
items = {};
// Remove the items cookie
$cookieStore.remove('items');
}
#/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"
@aaronroberson
aaronroberson / add-cart-button.html
Last active November 13, 2015 13:41
Geekwise2 Day 7 - Shopping Cart
<button class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Add to cart</button>